/**
 * 初始化案件基本数据
 */
function initCaseBasicData(){
	findCaseFillingPlaceByOrganIdOffLine(organId,setCaseFillingPlace);
	/*if(online){
		$("#fillingPlace").combobox({
			url:getContextPath() + '/caseBasicInfo/getCaseFillingPlace?organId='+organId,
	        method:'get',
	        valueField:'address',
	        textField:'address',
	        width:200,
			height:32
		});
	}else{
		$("#fillingPlace").combobox({
	        width:200,
			height:32
		});
	}*/
	
	findOrganById(organId,setOrgandata);
	
	findAdministrativePunishmentByOrganIdOffLine(organId,setAdministrativePunishment);
}

/**
 * 设置行政处罚种类
 * @param data
 */
function setAdministrativePunishment(data){
	if(data ==null || data.length<=0){
		$("#punishType").combobox({});
		return;
	}
	$("#punishType").combobox({
        method:'get',
        valueField:'administrativePunishmentName',
        textField:'administrativePunishmentName',
        width:200,
		height:32,
		data:data
	});
	  var data = $('#punishType').combobox('getData');
      if (data.length > 0) {
          $('#punishType').combobox('select', data[0].administrativePunishmentName);
	   }
}
/**
 * 设置立案机构地址
 */
function setCaseFillingPlace(data){
	if(data ==null || data.length<=0){
		$("#fillingPlace").combobox({
			width:200,
			height:32
		});
		return;
	}
	$("#fillingPlace").combobox({
        method:'get',
        valueField:'address',
        textField:'address',
        width:200,
		height:32,
		data:data
	});
	  var data = $('#fillingPlace').combobox('getData');
      if (data.length > 0) {
          $('#fillingPlace').combobox('select', data[0].address);
	   }
}




/**
 * 设置机构数据
 */
function setOrgandata(data){
	/*$("#organAddress").textbox('setValue',data.address);
	$("#organZipCode").textbox('setValue',data.zipCode);
	$("#organContactor").textbox('setValue',data.contactor);
	$("#organTel").textbox('setValue',data.telephone);*/
	
	$("#organAddress").val(data.address);
	$("#organZipCode").val(data.zipCode);
	$("#organContactor").val(data.contactor);
	$("#organTel").val(data.telephone);
}

/**
 * 初始化页面所需的抽屉表数据
 * @param data 
 * @param $con 容器节点
 */
function initCaseDrawer(data,$con){
	var value = $($con).val();
	$($con).combobox({
		valueField: 'name',
		textField: 'name',
		data:data,
		value:data[0].name
	});
	if($.trim(value).length!=0){
		$($con).combobox('select',value);
	}
	
/*	$.each(data, function(i,item){
		$($con).append("<option value='"+item.name+"'>"+item.name+"</option>");  
	});*/
}
/**
 * 文本框样式
 * @param $con
 */
function textClass($con){
	$($con).each(function(){
		$(this).textbox({
			width:200,
			height:30
		});
	});
}

/**
 *文书文本框样式
 * @param $con
 */
function textWsClass($con){
	$($con).each(function(){
		$(this).textbox({
			width:120,
			height:30
		});
	});
}
/**
 * 文书日期文本框样式(特殊)
 * @param $con
 */
function textClassCommon($con){
	$($con).each(function(){
		$(this).textbox({
			width:70,
			height:30
		});
	});
}
/**
 * 文本框多行样式
 * @param $con
 */
function textMultisClass($con){
	$($con).each(function(){
		$(this).textbox({
			width:450,
			height:50,
			multiline:true
		});
	});
}

/**
 * 文本框多行样式(特殊)
 * @param $con
 */
function textMultisClassCommon($con){
	$($con).each(function(){
		$(this).textbox({
			width:480,
			height:40,
			multiline:true
		});
	});
}

/**
 * 文本框多行样式(特殊)
 * @param $con
 */
function textMultisClassTextarea($con){
	$($con).each(function(){
		$(this).textbox({
			width:200,
			height:40,
			multiline:true
		});
	});
}
/**
 * 数字文本框样式
 * @param $con
 * @param precision精度
 */
function numberClass($con,precision){
	$.each($con,function(index,item){
		$(item).numberbox({
			width:200,
			height:30,
			precision:precision
		});
	});
}
/**
 * 数字文本框样式(特殊)
 * @param $con
 * @param precision精度
 */
function numberClassCommon($con,precision){
	$.each($con,function(index,item){
		$(item).numberbox({
			width:50,
			height:30,
			precision:precision
		});
	});
}
/**
 * 日期文本框样式
 * @param $con
 * @param precision精度
 */
function dateClass($con){
	$($con).each(function(index,item){
		$(this).datebox({
			width:200,
			height:30
		});
	});
}
/**
 * 日期时间文本框样式
 * @param $con
 * @param precision精度
 */
function dateTimeClass($con){
	$($con).each(function(index,item){
		$(this).datetimebox({
			width:200,
			height:30
		});
	});
}

/**
 * 下拉列表样式
 * @param $con
 */
function selectClass($con){
	$($con).each(function(){
		$(this).combobox({
			width:200,
			height:30,
			editable:false
		});
	});
}


/**
 * 下拉列表样式(允许手输)
 * @param $con
 */
function selectClassCommon($con){
	$($con).each(function(){
		$(this).combobox({
			width:100,
			height:30,
			editable:true
		});
	});
}
/**
 * 加载html文件
 * @param url  地址
 * @param $con 容器节点
 * @param callback 回调函数
 */
function loadHtml(url,$con,callback){
	$.ajax({
	    async:false,
		type : "get",
		//cache:false,
		url : url,
		dataType : "html",
		success : function(data) {
			$($con).append(data);
			$.parser.parse();
			if(typeof(callback) == 'function'){
				callback();
			}
		}
	 });
}

/**
 * 保存成功后，设置隐藏域案件ID
 */
function setDataId(data,formId){
	$(formId+" #id").val(data.id);
}

/**
 * 修改文书打印样式
 * @param spanId
 */
function setWSPrintClass(spanId){
	$(spanId + "Print").each(function(index,item){
		$(this).css('color', 'blue');
	});
}
/**
 * 获得json值，设置给标签
 * @param data
 */
function setData(data,formId){
	if(data == null || data==undefined)
		return;
	if(data['partyType']!=undefined && ""!=data['partyType']){
		   if(data['partyType']=="个人"){
			   $(formId + " input[id='party1']").textbox('setValue',data['party']==undefined?'':data['party']);
			   $(formId + " input[id='partyTel1']").textbox('setValue',data['partyTel']==undefined?'':data['partyTel']);
			   $(formId + " input[id='partyAddress1']").textbox('setValue',data['partyAddress']==undefined?'':data['partyAddress']);
		   }else{
			   $(formId + " input[id='party2']").textbox('setValue',data['party']==undefined?'':data['party']);
			   $(formId + " input[id='partyTel2']").textbox('setValue',data['partyTel']==undefined?'':data['partyTel']);
			   $(formId + " input[id='partyAddress2']").textbox('setValue',data['partyAddress']==undefined?'':data['partyAddress']);
		   }
		}
	$.each(data,function(key,value){
		if($.trim(value).length != 0){
			$(formId + " input.easyui-textbox[id='"+key+"']").each(function(index,item){
				$(this).textbox('setValue',value);
			});
			$(formId + " input.easyui-datebox[id='"+key+"']").each(function(index,item){
				$(this).datebox('setValue',value);
			});
			$(formId + " input.easyui-datetimebox[id='"+key+"']").each(function(index,item){
				$(this).datetimebox('setValue',value);
			});
			$(formId + " select.easyui-combobox[id='"+key+"']").each(function(index,item){
				$(this).combobox('select',value);
			});
			$(formId + " input.easyui-numberbox[id='"+key+"']").each(function(index,item){
				$(this).numberbox('setValue',value);
			});
			$(formId + " input[id="+key+"]").each(function(index,item){
				$(this).val(value);
			});
			$(formId + " span[id="+key+"]").each(function(index,item){
				$(this).text(value);
				if("punishAmount"==key || "stageAmount"==key || "notYetPaidAmount"==key){
					$(this).text(chineseNumber(value));
				}
				if("delayToYear" == key || "stageToYear" == key){
					$(this).text(convertToChinese(value));
				}
				if("delayToMonth" == key || "delayToDay" == key || "stageToMonth" == key || "stageToDay" == key){
					$(this).text(number(value));
				} 
				if("vehicleShipId" == key){
					$(formId+" #vehicleShipId1").text(value);
					$(formId+" #vehicleShipId2").text(value);
					$(formId+" #vehicleShipId3").text(value);
				}
			});
//			$("input.easyui-textbox[attr=common][id='"+key+"']").each(function(index,item){
//				$(this).textbox('setValue',value);
//			});
//			$("input.easyui-datebox[attr=common][id='"+key+"']").each(function(index,item){
//				$(this).datebox('setValue',value);
//			});
//			$("input.easyui-datetimebox[attr=common][id='"+key+"']").each(function(index,item){
//				$(this).datetimebox('setValue',value);
//			});
//			$("select.easyui-combobox[attr=common][id='"+key+"']").each(function(index,item){
//				$(this).combobox('setValue',value);
//			});
//			$("input.easyui-numberbox[attr=common][id='"+key+"']").each(function(index,item){
//				$(this).numberbox('setValue',value);
//			});
//			$("input[attr=common][id="+key+"]").each(function(index,item){
//				$(this).val(value);
//			});
		}
		
	});
	/**
	 * 对处罚金额的汉化处理
	 */
//	if(""!=data['punishDecision'] && data['punishDecision']!=undefined){
//		$(formId + " input[id='punishDecisionCapital']").textbox('setValue',data['punishDecision']==undefined?'':chineseNumber(data['punishDecision']));
//	}
	if(""!=data['punishAmount'] && data['punishAmount']!=undefined){
		$(formId + " input[id='punishAmountCapital']").textbox('setValue',data['punishAmount']==undefined?'':chineseNumber(data['punishAmount']));
	}
	if(""!=data['stageAmount'] && data['stageAmount']!=undefined){
		$(formId + " input[id='stageAmountCapital']").textbox('setValue',data['stageAmount']==undefined?'':chineseNumber(data['stageAmount']));
	}
	if(""!=data['notYetPaidAmount'] && data['notYetPaidAmount']!=undefined){
		$(formId + " input[id='notYetPaidAmountCapital']").textbox('setValue',data['notYetPaidAmount']==undefined?'':chineseNumber(data['notYetPaidAmount']));
	}
	if(""!=data['delayToYear'] && data['delayToYear']!=undefined){
		$(formId + " input[id='delayToYearCapital']").textbox('setValue',data['delayToYear']==undefined?'':convertToChinese(data['delayToYear']));
	}
	if(""!=data['stageToYear'] && data['stageToYear']!=undefined){
		$(formId + " input[id='stageToYearCapital']").textbox('setValue',data['stageToYear']==undefined?'':convertToChinese(data['stageToYear']));
	}
	if(""!=data['delayToMonth'] && data['delayToMonth']!=undefined){
		$(formId + " input[id='delayToMonthCapital']").textbox('setValue',data['delayToMonth']==undefined?'':number(data['delayToMonth']));
	}
	if(""!=data['delayToDay'] && data['delayToDay']!=undefined){
		$(formId + " input[id='delayToDayCapital']").textbox('setValue',data['delayToDay']==undefined?'':number(data['delayToDay']));
	}
	if(""!=data['stageToMonth'] && data['stageToMonth']!=undefined){
		$(formId + " input[id='stageToMonthCapital']").textbox('setValue',data['stageToMonth']==undefined?'':number(data['stageToMonth']));
	}
	if(""!=data['stageToDay'] && data['stageToDay']!=undefined){
		$(formId + " input[id='stageToDayCapital']").textbox('setValue',data['stageToDay']==undefined?'':number(data['stageToDay']));
	}
	/**
	 * 部分文书页面有同时有多个申请人或被申请人
	 */
	if(data['party']!=undefined && ""!=data['party']){
		 $("input",$(formId+" #party").next("span")).trigger('blur');
	}
	if(data['respondent']!=undefined && ""!=data['respondent']){
		$("input",$(formId+" #respondent").next("span")).trigger('blur');
	}
	
	/**
	 * 部分文书页面有同时有多个驾驶人和扣留地址
	 */
	if(data['driverName']!=undefined && ""!=data['driverName']){
		 $("input",$(formId+" #driverName").next("span")).trigger('blur');
	}
	if(data['detainAddress']!=undefined && ""!=data['detainAddress']){
		$("input",$(formId+" #detainAddress").next("span")).trigger('blur');
	}
	
	/**
	 * 部分文书页面有同时有多个委托人或被代理人
	 */
	if(data['entruster']!=undefined && ""!=data['entruster']){
		 $("input",$(formId+" #entruster").next("span")).trigger('blur');
	}
	if(data['proxy']!=undefined && ""!=data['proxy']){
		$("input",$(formId+" #proxy").next("span")).trigger('blur');
	}
	
	/**
	 * 部分文书页面有多个车牌号码元素
	 */
	if(data['vehicleShipId']!=undefined && ""!=data['vehicleShipId']){
		$("input",$(formId+" #vehicleShipId").next("span")).trigger('blur');
	}
	if(data['fillingPlace']!=undefined && ""!=data['fillingPlace']){
		$("input",$(formId+" #fillingPlace").next("span")).trigger('blur');
	}
	/*for(var key in data)
	{
	    alert("Key是:" + key);
	    alert("对应的值是:" + data[key]);
	}*/
}

/**
 * 设置文书 案件编号
 * @param formId
 * @param casenumber
 */
function setDocCaseNumber(formId,casenumber){
	var indexsign = casenumber.indexOf("字[");
	var caseIdword=casenumber.substring(0,indexsign);
	$(formId+" #caseIdWord").textbox('setValue',caseIdword);
	var prefix1=casenumber.indexOf("[");
	var prefix2=casenumber.indexOf("]");
	var suffix=casenumber.indexOf("号");
	var caseIdno=casenumber.substring(prefix2+1,suffix);
	$(formId+" #caseIdNo").textbox('setValue',caseIdno);
	var caseIdyear=casenumber.substring(prefix1+1,prefix2);
	$(formId+ " #caseIdYear").textbox('setValue',caseIdyear);
}

/**
 * 通过机构ID和是否公共获取行政处罚种类列表
 * @param organId
 * @param callback
 */
function findAdministrativePunishmentByOrganIdOffLine(organId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_ADMINISTRATIVE_PUNISHMENT WHERE IS_COMMON='是' OR (ORGAN_ID=? AND IS_COMMON='否')", [organId], 
		function (tx, result){ 
		    var data = setAdministrativePunishmentDataOffLine(result);
    	    if(typeof(callback) == 'function'){
    	    	callback(data);
    	    }
	    }, 
	    function(tx, ex) {
        });  
	});
}

/**
 * 通过案件ID获取案件信息
 * @param caseBasicInfoId
 * @param callback
 */
function findCaseBasicInfoByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() + "/caseBasicInfo/queryCaseBasicInfo",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result == "success"){
				if(typeof(callback)=='function'){
					callback(data.caseBasicInfo,"#caseBasicInfoForm");
				}
				return data.caseBasicInfo;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取案件处理记录信息
 * @param caseBasicInfoId
 * @param linkNameId
 * @param linkName
 * @param callback
 */
function findCaseBasicInfoClByIdOnLine(caseBasicInfoId,linkNameId,linkName,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() + "/caseBasicInfo/queryCaseBasicInfoCl",
		data : {
			id : caseBasicInfoId,caseStep:linkName
		},
		dataType : "json",
		success : function(data) {
			if(data.result == "success"){
				if(data.caseBasicInfoCl == null){
					return;
				}
				if(typeof(callback)=='function'){
					callback(data.caseBasicInfoCl,linkNameId);
				}
				return data.caseBasicInfoCl;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取现场笔录
 * @param caseBasicInfoId
 * @param callback
 */
function findSceneNotesByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/querySceneNotes",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.sceneNotes,"#sceneNotesForm");
					}
				 return data.sceneNotes;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取勘验笔录 
 * @param caseBasicInfoId
 * @param callback
 */
function findInquestNotesByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryInquestNotes",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.inquestNotes,"#inquestNotesForm");
					}
				 return data.inquestNotes;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 获取在询问件列表
 * @param caseBasicInfoId 案件ID
 * @param callback 回调函数
 */
function findInquiryNotesByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
        type: "POST",
        url:getContextPath()+"/caseBasicInfo/queryInquiryNotes",
        dataType:"json",
        data:{id:caseBasicInfoId},
        success: function(data) {
        	if(data.result=='success'){
        	  if(typeof(callback) == 'function')
        		callback(data.inquiryNotes,"#inquiryNotesForm");
        	}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
        },
        error: function(request) {
            message("获取询问笔录列表失败");
        }
    });
}

function findInquiryCountOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "GET",
		url : getContextPath() +"/caseBasicInfo/queryInquiryCount",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.content,"#inquiryNotesForm");
					}
				 return data.content;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取立案审批
 * @param caseBasicInfoId
 * @param callback
 */
function findFillingApproveByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryFillingApprove",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.fillingApprove,"#fillingApproveForm");
					}
				 return data.fillingApprove;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取听证公告
 * @param caseBasicInfoId
 * @param callback
 */
function findHearingBulletinByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryHearingBulletin",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.hearingBulletin,"#hearingBulletinForm");
					}
				 return data.hearingBulletin;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取听证通知书
 * @param caseBasicInfoId
 * @param callback
 */
function findHearingNoticeByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryHearingNotice",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.hearingNotice,"#hearingNoticeForm");
					}
				 return data.hearingNotice;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 听证报告书
 * @param caseBasicInfoId
 * @param callback
 */
function findHearingReportByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryHearingReport",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.hearingReport,"#hearingReportForm");
					}
				 return data.hearingNotice;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 听证笔录 
 * @param caseBasicInfoId
 * @param callback
 */
function findHearingNotesByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryHearingNotes",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.hearingNotes,"#hearingNotesForm");
					}
				 return data.hearingNotes;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}
/**
 * 通过案件ID获取 听证委托书
 * @param caseBasicInfoId
 * @param callback
 */
function findHearingEntrustByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "POST",
		url : getContextPath() +"/caseBasicInfo/queryHearingEntrust",
		dataType : "json",
		data : {id:caseBasicInfoId},
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
					    callback(data.hearingEntrust,"#hearingEntrustForm");
					}
				 return data.hearingEntrust;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}
/**
 * 通过案件ID获取行政强制执行申请书
 * @param caseBasicInfoId
 * @param callback
 */
function findAdminEnforceApplicationByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryAdminEnforceApplication",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			 if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.adminEnforceApplication,"#adminEnforceApplicationForm");
					}
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}

		}
	});
}

/**
 * 通过案件ID获取协助调查函
 * @param caseBasicInfoId
 * @param callback
 */
function findAssistInvestByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryAssistInvest",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.assistInvest,"#assistInvestForm");
					}
				 return data.assistInvest;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取回避申请书
 * @param caseBasicInfoId
 * @param callback
 */
function findAvoidApplyByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryAvoidApply",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
					 if(null !=data.avoidApply){
					    var time=data.avoidApply['makeDate'];
					    if($.trim(time).length !=0){
					    	var timearr=time.replace(" ",":").replace(/\:/g,"-").split("-"); 
							data.avoidApply['applyYear']=timearr[0];
							data.avoidApply['applyMonth']=timearr[1];
							data.avoidApply['applyDay']=timearr[2];
					    }
					 }
						callback(data.avoidApply,"#avoidApplyForm");
					}
				 return data.avoidApply;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 同意回避申请书
 * @param caseBasicInfoId
 * @param callback
 */
function findAvoidApplyAgreeByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryAvoidApplyAgree",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.avoidApplyAgree,"#avoidApplyAgreeForm");
					}
				 return data.avoidApplyAgree;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 驳回回避申请书 
 * @param caseBasicInfoId
 * @param callback
 */
function findAvoidApplyRejectByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryAvoidApplyReject",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.avoidApplyReject,"#avoidApplyRejectForm");
					}
				 return data.avoidApplyReject;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 分期（延期）缴纳罚款申请书
 * @param caseBasicInfoId
 * @param callback
 */
function findDelayPayfineApplyByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryDelayPayfineApply",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(null !=data.delayPayfineApply){
				    var time=data.delayPayfineApply['signatureDate1'];
				    if($.trim(time).length !=0){
				    	var timearr=time.replace(" ",":").replace(/\:/g,"-").split("-"); 
						data.delayPayfineApply['applyYear']=timearr[0];
						data.delayPayfineApply['applyMonth']=timearr[1];
						data.delayPayfineApply['applyDay']=timearr[2];
				    }
				 }
				 if(typeof(callback)=='function'){
						callback(data.delayPayfineApply,"#delayPayfineApplyForm");
					}
				 return data.delayPayfineApply;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 同意分期（延期）缴纳罚款通知书
 * @param caseBasicInfoId
 * @param callback
 */
function findDelayPayfineApplyAgreeByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryDelayPayfineApplyAgree",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.delayPayfineApplyAgree,"#delayPayfineApplyAgreeForm");
					}
				 return data.delayPayfineApplyAgree;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取  不予分期（延期）缴纳罚款通知书
 * @param caseBasicInfoId
 * @param callback
 */
function findNondelayPayfineApplyByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryNondelayPayfineApply",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.nondelayPayfineApply,"#nondelayPayfineApplyForm");
					}
				 return data.nondelayPayfineApply;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取  行政处罚决定书 
 * @param caseBasicInfoId
 * @param callback
 */
function findPunishementDecisionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryPunishementDecision",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.punishementDecision,"#punishementDecisionForm");
					}
				 return data.punishementDecision;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取  处罚结案报告
 * @param caseBasicInfoId
 * @param callback
 */
function findPunishmentFinalReportByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryPunishmentFinalReport",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.punishmentFinalReport,"#punishmentFinalReportForm");
					}
				 return data.punishmentFinalReport;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取  不予行政处罚决定书 
 * @param caseBasicInfoId
 * @param callback
 */
function findNonpunishmentDecisionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryNonpunishmentDecision",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.nonpunishmentDecision,"#nonpunishmentDecisionForm");
					}
				 return data.nonpunishmentDecision;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 责令改正通知书 
 * @param caseBasicInfoId
 * @param callback
 */
function findOrderCorrectByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryOrderCorrect",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.orderCorrect,"#orderCorrectForm");
					}
				 return data.orderCorrect;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 证据登记保存处理决定书 
 * @param caseBasicInfoId
 * @param callback
 */
function findEvidenceTreatmentDecisionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEvidenceTreatmentDecision",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.evidenceTreatmentDecision,"#evidenceTreatmentDecisionForm");
					}
				 return data.evidenceTreatmentDecision;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 证据保存清单明细
 */
function findEvidenceListDetailsByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEvidenceList",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback("#evidenceTreatmentDecisionForm",data.evidenceListDetail);
					}
				 return data.evidenceListDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}
/**
 * 通过案件ID获取 鉴定意见书
 * @param caseBasicInfoId
 * @param callback
 */
function findIdentifyOpinionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryIdentifyOpinion",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.identifyOpinion,"#identifyOpinionForm");
					}
				 return data.identifyOpinion;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 违法行为通知书
 * @param caseBasicInfoId
 * @param callback
 */
function findIllegalActionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryIllegalAction",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.illegalAction,"#illegalActionForm");
					}
				 return data.illegalAction;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 重大案件集体讨论记录
 * @param caseBasicInfoId
 * @param callback
 */
function findImportantCaseGroupDiscussionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryImportantCaseGroupDiscussion",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.importantCaseGroupDiscussion,"#importantCaseGroupDiscussionForm");
					}
				 return data.importantCaseGroupDiscussion;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 举报记录 
 * @param caseBasicInfoId
 * @param callback
 */
function findReportRecordByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryReportRecord",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.reportRecord,"#reportRecordForm");
					}
				 return data.reportRecord;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}
/**
 * 通过案件ID获取 行政（当场）处罚决定书
 * @param caseBasicInfoId
 * @param callback
 */
function findSpotPunishmentDecisionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/querySpotPunishmentDecision",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.spotPunishmentDecision,"#spotPunishmentDecisionForm");
					}
				 return data.spotPunishmentDecision;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 行政（当场）处罚决定书陈述申辩书
 * @param caseBasicInfoId
 * @param callback
 */
function findStatementExplainByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryStatementExplain",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.statementExplain,"#statementExplainForm");
					}
				 return data.statementExplain;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 案件处理意见书
 * @param caseBasicInfoId
 * @param callback
 */
function findCaseProcessIdeaByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryCaseProcessIdea",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.caseProcessIdea,"#caseProcessIdeaForm",data.caseProcessIdeaDetail);
					}
				 return data.caseProcessIdea;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过ID获取 案件处理意见书明细
 * @param caseProcessIdeaDetailId
 * @param callback
 */
function findCaseProcessIdeaDetailByIdOnLine(caseProcessIdeaDetailId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryCaseProcessIdeaDetailById",
		data : {
			id : caseProcessIdeaDetailId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.caseProcessIdeaDetail,"#caseProcessIdeaDetailForm");
					}
				 return data.caseProcessIdeaDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 文书送达回证
 * @param caseBasicInfoId
 * @param callback
 */
function findDocumentReceiptByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryDocumentReceipt",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.documentReceipt,"#documentReceiptForm",data.documentReceiptDetail);
					}
				 return data.documentReceipt;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过ID获取 文书送达回证明细
 * @param documentReceiptDetailId
 * @param callback
 */
function findDocumentReceiptDetailByIdOnLine(documentReceiptDetailId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryDocumentReceiptDetailById",
		data : {
			id : documentReceiptDetailId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.documentReceiptDetail,"#documentReceiptDetailForm");
					}
				 return data.documentReceiptDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}



/**
* 通过案件ID获取 委托鉴定书
* @param caseBasicInfoId
* @param callback
*/
function findEntrustIdentifyByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEntrustIdentify",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.entrustIdentify,"#entrustIdentifyForm",data.entrustIdentifyDetail);
					}
				 return data.entrustIdentify;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过ID获取 委托鉴定书明细
 * @param entrustIdentifyDetailId
 * @param callback
 */
function findEntrustIdentifyDetailByIdOnLine(entrustIdentifyDetailId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEntrustIdentifyDetailById",
		data : {
			id : entrustIdentifyDetailId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.entrustIdentifyDetail,"#entrustIdentifyDetailForm");
					}
				 return data.entrustIdentifyDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 证据登记保存清单
 * @param caseBasicInfoId
 * @param callback
 */
function findEvidenceListByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEvidenceList",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.evidenceList,"#evidenceListForm",data.evidenceListDetail);
					}
				 return data.evidenceList;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过ID获取 证据登记保存清单明细
 * @param evidenceListDetailId
 * @param callback
 */
function findEvidenceListDetailByIdOnLine(evidenceListDetailId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEvidenceListDetailById",
		data : {
			id : evidenceListDetailId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.evidenceListDetail,"#evidenceListDetailForm");
					}
				 return data.evidenceListDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}


/**
 * 通过案件ID获取 抽样取证凭证
 * @param caseBasicInfoId
 * @param callback
 */
function findSampleEvidenceByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/querySampleEvidence",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.sampleEvidence,"#sampleEvidenceForm",data.sampleEvidenceDetail);
					}
				 return data.sampleEvidence;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过ID获取 抽样取证凭证明细
 * @param evidenceListDetailId
 * @param callback
 */
function findSampleEvidenceDetailByIdOnLine(sampleEvidenceDetailId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/querySampleEvidenceDetailById",
		data : {
			id : sampleEvidenceDetailId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.sampleEvidenceDetail,"#sampleEvidenceDetailForm");
					}
				 return data.sampleEvidenceDetail;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID获取 封皮
 * @param caseBasicInfoId
 * @param callback
 */
function findCoverByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoYn/queryCover",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.cover,"#coverForm");
				}
				return data.cover;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过机构ID,案件ID查找已经办理的文书
 * @param organId
 * @param callback
 */
function findDocsByOidOnLine(organId,callback){
	$.ajax({
		type : "get",
		url : getContextPath() + "/caseBasicInfoYn/queryFileListData",
		data : {
			organId : organId,
			caseBasicInfoId : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(typeof(callback) == 'function'){
				callback(data.fileList);
			}
		}
	});
}

/**
 * 通过案件ID获取 卷内目录
 * @param casebasicInfoId
 * @param callback
 */
function findFileListByIdOnLine(casebasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoYn/queryFileList",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.fileList,"#fileListForm",data.fileListDetail);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取卷内目录列表失败");
        }
	});
}

/**
 * 通过机构ID,案件ID查找已经办理的文书
 * @param organId
 * @param callback
 */
function findHBDocsByOidOnLine(organId,callback){
	$.ajax({
		type : "get",
		url : getContextPath() + "/caseBasicInfoHb/queryFileClanListData",
		data : {
			organId : organId,
			caseBasicInfoId : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(typeof(callback) == 'function'){
				callback(data.fileClanList);
			}
		}
	});
}

/**
 * 通过案件ID获取 卷宗目录
 * @param casebasicInfoId
 * @param callback
 */
function findFileClanListByIdOnLine(casebasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHb/queryFileClanList",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function')
					callback(data.fileClanList,"#fileClanListForm",data.fileClanListDetail);
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		},
		error: function(request) {
			message("获取卷宗目录列表失败");
		}
	});
}

/**
 * 通过案件ID获取 卷内备考表
 * @param caseBasicInfoId
 * @param callback
 */
function findFileNoteByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoYn/queryFileNote",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
				callback(data.fileNote,"#fileNoteForm");
				}
				return data.fileNote;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取 暂扣凭证
 * @param casebasicInfoId
 * @param callback
 */
function findWithholdCertificateByIdOnLine(casebasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryWithholdCertificate",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
				callback(data.withholdCertificate,"#withholdCertificateForm");
				}
				return data.withholdCertificate;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取交通行政执法卷宗
 * @param caseBasicInfoId
 * @param callback
 */
function findAdministrationEnforceLawFileByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHb/queryAdministrationEnforceLawFile",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.administrationEnforceLawFile,"#administrationEnforceLawFileForm");
				}
				return data.administrationEnforceLawFile;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取湖北交通行政执法卷宗
 * @param caseBasicInfoId
 * @param callback
 */
function findAdministrationEnforceLawFileByIdOffLine(caseBasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ADMINENFORCEFILE  WHERE CASE_BASICINFO_ID = '+parseInt(caseBasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取湖北省交通行政执法卷宗错误");
		    	return;
		    }
		    data = setAdministrationEnforceLawFileOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#administrationEnforceLawFileForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("湖北省交通行政执法卷宗不存在");
        });  
	});
}

/**
 * 通过案件ID获取公路路政案件卷宗
 * @param caseBasicInfoId
 * @param callback
 */
function findRoadCaseFileByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHb/queryRoadCaseFile",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.roadCaseFile,"#roadCaseFileForm");
				}
				return data.roadCaseFile;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取湖北交通公路路政案件卷宗
 * @param caseBasicInfoId
 * @param callback
 */
function findRoadCaseFileByIdOffLine(caseBasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ROADCASEFILE  WHERE CASE_BASICINFO_ID = '+parseInt(caseBasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取湖北省公路路政案件卷宗错误");
		    	return;
		    }
		    data = setRoadCaseFileOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#roadCaseFileForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("湖北省交通公路路政案件卷宗不存在");
        });  
	});
}

/**
 * 通过案件ID获取车辆(工具)扣留凭证
 * @param caseBasicInfoId
 * @param callback
 */
function findVehicleToolsDetainVoucherByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHb/queryVehicleToolsDetainVoucher",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.vehicleToolsDetainVoucher,"#vehicleToolsDetainVoucherForm");
				}
				return data.vehicleToolsDetainVoucher;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取离线车辆(工具)扣留凭证
 * @param caseBasicInfoId
 * @param callback
 */
function findVehicleToolsDetainVoucherByIdOffLine(caseBasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_VEHICLETOOLVOUCHER  WHERE CASE_BASICINFO_ID = '+parseInt(caseBasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
			if(len > 1){
				message("获取车辆(工具)扣留凭证错误");
				return;
			}
			data = setVehicleToolsDetainVoucherOffLine(result);
			if(typeof(callback) == 'function'){
				callback(data[0],"#vehicleToolsDetainVoucherForm");
			}
			return data[0];
		}, 
		function(tx, error) {
			message("车辆(工具)扣留凭证不存在");
		});  
	});
}

/**
 * 通过案件ID获取车辆暂扣凭证
 * @param caseBasicInfoId
 * @param callback
 */
function findVehicleDetainVoucherByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHb/queryVehicleDetainVoucher",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.vehicleDetainVoucher,"#vehicleDetainVoucherForm");
				}
				return data.vehicleDetainVoucher;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID获取离线车辆暂扣凭证
 * @param caseBasicInfoId
 * @param callback
 */
function findVehicleDetainVoucherByIdOffLine(caseBasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_VEHICLEVOUCHER  WHERE CASE_BASICINFO_ID = '+parseInt(caseBasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
			if(len > 1){
				message("获取车辆暂扣凭证错误");
				return;
			}
			data = setVehicleDetainVoucherOffLine(result);
			if(typeof(callback) == 'function'){
				callback(data[0],"#vehicleDetainVoucherForm");
			}
			return data[0];
		}, 
		function(tx, error) {
			message("车辆暂扣凭证不存在");
		});  
	});
}

/**
 * 通过案件ID获取 现场笔录
 * @param casebasicInfoId
 * @param callback 
 */
function findSceneNotesByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SCENENOTES  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
		    var len = result.rows.length;
		    var data = new Array();
		    if(len > 1){
		    	message("获取现场笔录错误");
		    	return;
		    }
		    data = setSceneNotesDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#sceneNotesForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("现场笔录不存在");
        });  
	});
}

/**
 * 通过案件ID获取 勘验笔录
 * @param casebasicInfoId
 * @param callback 
 */
function findInquestNotesByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_INQUESTNOTES  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取勘验笔录错误");
		    	return;
		    }
		    data = setInquestNotesDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#inquestNotesForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("勘验笔录不存在");
        });  
	});
}

/**
 * 获取询问笔录列表
 */
function findInquiryNotesByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_INQUIRYNOTES  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId)+'  order by INQUIRY_INDEX', [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
				data=setInquiryNotesDataOffLine(result);
		   if(typeof(callback) == 'function'){
			 if(len>0){
				 callback(data,"#inquiryNotesForm");
			 }else{
				 callback(data[0],"#inquiryNotesForm");
			  }
   	        }
		   return data[0];
		   
	    }, 
	    function(tx, error) {
	    	message("获取询问笔录列表失败:"+ error.message);
        });  
	});
}

function findInquiryCountOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_INQUIRYNOTES  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
//			var data = new Array();
//		    if(len > 1){
//		    	message("获取询问次数序号错误");
//		    	return;
//		    }MAX(INQUIRY_INDEX)
//		    data = setInquiryNotesCountOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(len,"#inquiryNotesForm");
    	    }
		    return len;
	    }, 
	    function(tx, error) {
	    	message("询问次数序号不存在");
		});
	});
}

/**
 * 通过案件ID获取 立案审批
 * @param casebasicInfoId
 * @param callback 
 */
function findFillingApproveByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_FILLINGAPPROVE WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取立案审批错误");
		    	return;
		    }
		    data = setFillingApproveDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#fillingApproveForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("立案审批不存在");
        });  
	});
}


/**
 * 通过案件ID获取 听证公告
 * @param casebasicInfoId
 * @param callback 
 */
function findHearingBulletinByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_HEARINGBULLETIN WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取听证公告错误");
		    	return;
		    }
		    data = setHearingBulletinDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#hearingBulletinForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("听证公告不存在");
        });  
	});
}

/**
 * 通过案件ID获取 听证通知书
 * @param casebasicInfoId
 * @param callback 
 */
function findHearingNoticeByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_HEARINGNOTICE WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取听证通知书错误");
		    	return;
		    }
		    data = setHearingNoticeDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#hearingNoticeForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("听证通知书不存在");
        });  
	});
}
/**
 * 通过案件ID获取 听证报告书
 * @param casebasicInfoId
 * @param callback 
 */
function findHearingReportByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_HEARINGREPORT WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取听证报告书错误");
		    	return;
		    }
		     data = setHearingReportDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#hearingReportForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("听证报告书不存在");
        });  
	});
}

/**
 * 通过案件ID获取 听证笔录
 * @param casebasicInfoId
 * @param callback 
 */
function findHearingNotesByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_HEARINGNOTES WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取听证笔录错误");
		    	return;
		    }
		    data = setHearingNotesDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#hearingNotesForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("听证笔录不存在");
        });  
	});
}

/**
 * 通过案件ID获取 听证委托书
 * @param casebasicInfoId
 * @param callback 
 */
function findHearingEntrustByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_HEARINGENTRUST WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取听证委托书错误");
		    	return;
		    }
		    data = setHearingEntrustDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#hearingEntrustForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("听证委托书不存在");
        });  
	});
}
/**
 * 通过案件ID获取 行政强制执行申请书
 * @param casebasicInfoId
 * @param callback 
 */
function findAdminEnforceApplicationByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_ADMINENFORCEAPPLICATION WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			 var len = result.rows.length;
			 var data = new Array();
			    if(len > 1){
			    	message("获取行政强制执行申请书错误");
			    	return;
			    }
			    data = setAdminEnforceApplicationDataOffLine(result);
			    if(typeof(callback) == 'function'){
	    	    	callback(data[0],"#adminEnforceApplicationForm");
	    	    }
			    return data[0];
		    }, 
		    function(tx, error) {
		    	message("行政强制执行申请书不存在");
	        });  
	});
}


/**
 * 通过案件ID获取 协助调查函
 * @param casebasicInfoId
 * @param callback
 */
function findAssistInvestByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_ASSISTINVEST WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			 var len = result.rows.length;
			 var data = new Array();
			    if(len > 1){
			    	message("获取协助调查函错误");
			    	return;
			    }
			    data = setAssistInvestDataOffLine(result);
			    if(typeof(callback) == 'function'){
	    	    	callback(data[0],"#assistInvestForm");
	    	    }
			    return data[0];
		    }, 
		    function(tx, error) {
		    	message("协助调查函不存在");
	        });  
	});
}

/**
 * 通过案件ID 获取回避申请书
 * @param casebasicInfoId
 * @param callback
 */
function findAvoidApplyByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_AVOIDAPPLY WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			 var len = result.rows.length;
			 var data = new Array();
			    if(len > 1){
			    	message("获取回避申请书错误");
			    	return;
			    }
			    data = setAvoidApplyDataOffLine(result);
			    if(typeof(callback) == 'function'){
	    	    	callback(data[0],"#avoidApplyForm");
	    	    }
			    return data[0];
		    }, 
		    function(tx, error) {
		    	message("回避申请书不存在");
	        });  
	});
}

/**
 * 通过案件ID 获取同意回避申请书
 * @param casebasicInfoId
 * @param callback
 */
function findAvoidApplyAgreeByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_AVOIDAPPLYAGREE WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取同意回避申请书错误");
		    	return;
		    }
		    data = setAvoidApplyAgreeDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#avoidApplyAgreeForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("同意回避申请书不存在");
        });  
	});
}


/**
 * 通过案件ID 驳回回避申请书
 * @param casebasicInfoId
 * @param callback
 */
function findAvoidApplyRejectByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_AVOIDAPPLYREJECT WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取驳回回避申请书错误");
		    	return;
		    }
		    data = setAvoidApplyRejectDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#avoidApplyRejectForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("驳回回避申请书不存在");
        });  
	});
}

/**
 * 通过案件ID 分期（延期）缴纳罚款申请书
 * @param casebasicInfoId
 * @param callback
 */
function findDelayPayfineApplyByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_DELAYPAYFINEAPPLY WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取分期（延期）缴纳罚款申请书错误");
		    	return;
		    }
		     data = setDelayPayfineApplyOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#delayPayfineApplyForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("分期（延期）缴纳罚款申请书不存在");
        });  
	});
}

/**
 * 通过案件ID 同意分期（延期）缴纳罚款通知书
 * @param casebasicInfoId
 * @param callback
 */
function findDelayPayfineApplyAgreeByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_DELAYPAYFINEAPPLYAGREE WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取同意分期（延期）缴纳罚款通知书错误");
		    	return;
		    }
		    data = setDelayPayfineApplyAgreeOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#delayPayfineApplyAgreeForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("同意分期（延期）缴纳罚款通知书不存在");
        });  
	});
}

/**
 * 通过案件ID 不予分期（延期）缴纳罚款通知书
 * @param casebasicInfoId
 * @param callback
 */
function findNondelayPayfineApplyByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_NONDELAYPAYFINEAPPLY  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取不予分期（延期）缴纳罚款通知书错误");
		    	return;
		    }
		    data = setNondelayPayfineApplyOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#nondelayPayfineApplyForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("不予分期（延期）缴纳罚款通知书不存在");
        });  
	});
}

/**
 * 通过案件ID 行政处罚决定书
 * @param casebasicInfoId
 * @param callback
 */
function findPunishementDecisionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_PUNISHMENTDECISION  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取行政处罚决定书错误");
		    	return;
		    }
		    data = setPunishementDecisionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#punishementDecisionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("行政处罚决定书不存在");
        });  
	});
}

/**
 * 通过案件ID 处罚结案报告
 * @param casebasicInfoId
 * @param callback
 */
function findPunishmentFinalReportByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_PUNISHMENTFINALREPORT  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取处罚结案报告错误");
		    	return;
		    }
		    data = setPunishmentFinalReportOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#punishmentFinalReportForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("处罚结案报告不存在");
        });  
	});
}

/**
 * 通过案件ID 案卷
 * @param casebasicInfoId
 * @param callback
 */
function findCoverByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_COVER WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			 var len = result.rows.length;
			 var data = new Array();
			    if(len > 1){
			    	message("获取案卷错误");
			    	return;
			    }
			    data = setCoverDataOffLine(result);
			    if(typeof(callback) == 'function'){
	    	    	callback(data[0],"#coverForm");
	    	    }
			    return data[0];
		    }, 
		    function(tx, error) {
		    	message("案卷不存在");
	        });  
	});
}

/**
 * 通过案件ID 卷内备考表
 * @param casebasicInfoId
 * @param callback
 */
function findFileNoteByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql("SELECT * FROM CASE_DOCU_FILENOTE WHERE CASE_BASICINFO_ID = "+parseInt(casebasicInfoId), [], function (tx, result){
			 var len = result.rows.length;
			 var data = new Array();
			    if(len > 1){
			    	message("获取卷内备考表错误");
			    	return;
			    }
			    data = setFileNoteDataOffLine(result);
			    if(typeof(callback) == 'function'){
	    	    	callback(data[0],"#fileNoteForm");
	    	    }
			    return data[0];
		    }, 
		    function(tx, error) {
		    	message("卷内备考表不存在");
	        });  
	});
}

/**
 * 通过案件ID 不予行政处罚决定
 * @param casebasicInfoId
 * @param callback
 */
function findNonpunishmentDecisionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_NONPUNISHMENTDECISION  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取不予行政处罚决定错误");
		    	return;
		    }
		    data = setNonpunishmentDecisionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#nonpunishmentDecisionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("不予行政处罚决定不存在");
        });  
	});
}

/**
 * 通过案件ID 责令改正通知书
 * @param casebasicInfoId
 * @param callback
 */
function findOrderCorrectByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ORDERCORRECT  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取责令改正通知书错误");
		    	return;
		    }
		    data = setOrderCorrectOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#orderCorrectForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("责令改正通知书不存在");
        });  
	});
}

/**
 * 通过案件ID 证据登记保存处理决定书
 * @param casebasicInfoId
 * @param callback
 */
function findEvidenceTreatmentDecisionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCETREATMENTDECISION WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取证据登记保存处理决定书错误");
		    	return;
		    }
		    data = setEvidenceTreatmentDecisionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#evidenceTreatmentDecisionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("证据登记保存处理决定书不存在");
        });  
	});
}

/**
 * 通过案件ID 鉴定意见书
 * @param casebasicInfoId
 * @param callback
 */
function findIdentifyOpinionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_IDENTIFYOPINION  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取鉴定意见书错误");
		    	return;
		    }
		    data = setIdentifyOpinionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#identifyOpinionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("鉴定意见书不存在");
        });  
	});
}

/**
 * 通过案件ID 违法行为通知书
 * @param casebasicInfoId
 * @param callback
 */
function findIllegalActionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ILLEGALACTION  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取违法行为通知书错误");
		    	return;
		    }
		    data = setIllegalActionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#illegalActionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("违法行为通知书书不存在");
        });  
	});
}

/**
 * 通过案件ID 重大案件集体讨论记录
 * @param casebasicInfoId
 * @param callback
 */
function findImportantCaseGroupDiscussionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_IMPORTANTCASEGROUPDISCUSSION WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取重大案件集体讨论记录错误");
		    	return;
		    }
		    data = setImportantCaseGroupDiscussionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#importantCaseGroupDiscussionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("重大案件集体讨论记录不存在");
        });  
	});
}
/**
 * 通过案件ID 举报记录
 * @param casebasicInfoId
 * @param callback
 */
function findReportRecordByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_REPORTRECORD  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取举报记录错误");
		    	return;
		    }
		    data = setReportRecordOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#reportRecordForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("举报记录不存在");
        });  
	});
}
/**
 * 通过案件ID 行政（当场）处罚决定书
 * @param casebasicInfoId
 * @param callback
 */
function findSpotPunishmentDecisionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SPOTPUNISHMENTDECISION  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取行政（当场）处罚决定书错误");
		    	return;
		    }
		    data = setSpotPunishmentDecisionOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#spotPunishmentDecisionForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("行政（当场）处罚决定书不存在");
        });  
	});
}

/**
 * 通过案件ID 陈述申辩书
 * @param casebasicInfoId
 * @param callback
 */
function findStatementExplainByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_STATEMENTEXPLAIN  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取陈述申辩书错误");
		    	return;
		    }
		    data = setStatementExplainOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#statementExplainForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("陈述申辩书不存在");
        });
	});
}

/**
 * 通过案件ID 案件处理意见书
 * @param casebasicInfoId
 * @param callback
 */
function findCaseProcessIdeaByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_CASEPROCESSIDEA WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取案件处理意见书错误");
		    	return;
		    }
		    data = setCaseProcessIdeaOffLine(result);
		    findCaseProcessIdeaDetailByEvidenceListIdOffLine(data[0],callback);
		    
		    /*if(typeof(callback) == 'function'){
    	    	callback(data[0],"#caseProcessIdeaForm");
    	    }
		    return data[0];*/
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("案件处理意见书不存在");
        });  
	});
}

/**
 * 获取案件处理意见书明细列表
 */
function findCaseProcessIdeaDetailByEvidenceListIdOffLine(caseProcessIdea,callback){
	var data = new Array();
	if(null==caseProcessIdea){
		if(typeof(callback) == 'function'){
  	    	 callback(caseProcessIdea,"#caseProcessIdeaForm",data);
  	        }
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_CASEPROCESSIDEA_DETAIL WHERE CASE_CASEPROCESSIDEA_ID = '+parseInt(caseProcessIdea.id), [], function (tx, result){
				   data=setCaseProcessIdeaDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback(caseProcessIdea,"#caseProcessIdeaForm",data);
		   	        }
			    }, 
			    function(tx, error) {
			    	message("获取案件处理意见书清单及明细列表失败:"+ error.message);
		        });  
		});
	}
}
/**
 * 通过ID获取 案件处理意见书明细
 * @param id
 * @param callback 
 */
function findCaseProcessIdeaDetailByIdOffLine(id,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_CASEPROCESSIDEA_DETAIL  WHERE CASE_CASEPROCESSIDEA_DETAIL_ID = '+parseInt(id), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取案件处理意见书明细错误");
		    	return;
		    }
		    data = setCaseProcessIdeaDetailDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#caseProcessIdeaDetailForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("案件处理意见书明细不存在");
        });  
	});
}


/**
 * 通过案件ID 文书送达回证
 * @param casebasicInfoId
 * @param callback
 */
function findDocumentReceiptByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_DOCUMENTRECEIPT WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取文书送达回证错误");
		    	return;
		    }
		    data = setDocumentReceiptOffLine(result);
		    findDocumentReceiptDetailByDocumentReceiptIdOffLine(data[0],callback);

		    /*if(typeof(callback) == 'function'){
    	    	callback(data[0],"#documentReceiptForm");
    	    }
		    return data[0];*/
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("文书送达回证不存在");
        });  
	});
}

/**
 * 获取文书送达回证及明细列表
 */
function findDocumentReceiptDetailByDocumentReceiptIdOffLine(documentReceipt,callback){
	var data = new Array();
	if(null==documentReceipt){
		if(typeof(callback) == 'function'){
			callback(documentReceipt,"#documentReceiptForm",data);
		}
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_DOCUMENTRECEIPT_DETAIL WHERE CASE_DOCUMENTRECEIPT_ID = '+parseInt(documentReceipt.id), [], function (tx, result){
				data=setDocumentReceiptDetailDataOffLine(result);
				if(typeof(callback) == 'function'){
					callback(documentReceipt,"#documentReceiptForm",data);
				}
			}, 
			function(tx, error) {
				message("获取文档送达回证及明细列表失败:"+ error.message);
			});  
		});
	}
}


/**
 * 通过ID获取 文书送达回证明细
 * @param id
 * @param callback 
 */

function findDocumentReceiptDetailByIdOffLine(id,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_DOCUMENTRECEIPT_DETAIL  WHERE CASE_DOCUMENTRECEIPT_DETAIL_ID = '+parseInt(id), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取文书送达回明细错误");
		    	return;
		    }
		    data = setDocumentReceiptDetailDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#documentReceiptDetailForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("文书送达回证明细不存在");
        });  
	});
}

/**
 * 通过案件ID 委托鉴定书
 * @param casebasicInfoId
 * @param callback
 */
function findEntrustIdentifyByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ENTRUSTIDENTIFY WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取委托鉴定书错误");
		    	return;
		    }
		    data = setEntrustIdentifyOffLine(result);
		    findEntrustIdentifyDetailByEntrustIdentifyIdOffLine(data[0],callback);
		    
//		    if(typeof(callback) == 'function'){
//    	    	callback(data[0],"#entrustIdentifyForm");
//    	    }
//		    return data[0];
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("委托鉴定书不存在");
        });  
	});	
}
/**
 * 获取委托鉴定书明细列表
 */
function findEntrustIdentifyDetailByEntrustIdentifyIdOffLine(entrustIdentify,callback){
	var data = new Array();
	if(null==entrustIdentify){
		if(typeof(callback) == 'function'){
  	    	 callback(entrustIdentify,"#entrustIdentifyForm",data);
  	        }
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_ENTRUSTIDENTIFY_DETAIL WHERE CASE_ENTRUSTIDENTIFY_ID = '+parseInt(entrustIdentify.id), [], function (tx, result){
				   data=setEntrustIdentifyDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback(entrustIdentify,"#entrustIdentifyForm",data);
		   	        }
			    }, 
			    function(tx, error) {
			    	message("获取委托鉴定书及明细列表失败:"+ error.message);
		        });  
		});
	}
}
/**
 * 通过ID获取 委托鉴定书明细
 * @param id
 * @param callback 
 */
function findEntrustIdentifyDetailByIdOffLine(id,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ENTRUSTIDENTIFY_DETAIL  WHERE CASE_ENTRUSTIDENTIFY_DETAIL_ID = '+parseInt(id), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取委托鉴定书明细错误");
		    	return;
		    }
		    data = setEntrustIdentifyDetailDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#entrustIdentifyDetailForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("委托鉴定书明细不存在");
        });  
	});
}

/**
 * 通过委托鉴定书ID获取 委托鉴定书明细
 * @param caseBasicInfoId
 * @param callback
 */
function findAllEntrustIdentifyDetailByIdOnLine(entrustIdentify,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEntrustIdentifyDetail",
		data : {
			id : entrustIdentify.id
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.entrustIdentifyDetail,"#entrustIdentifyDetailForm",entrustIdentify);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取委托鉴定书明细列表失败");
        }
	});
}

/**
 * 获取证据保存清单明细列表
 */
function findEvidenceListDetailByEvidenceListIdOffLine(evidenceList,callback){
	var data = new Array();
	if(null==evidenceList){
		if(typeof(callback) == 'function'){
  	    	 callback(evidenceList,"#evidenceListForm",data);
  	        }
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST_DETAIL WHERE CASE_EVIDENCELIST_ID = '+parseInt(evidenceList.id), [], function (tx, result){
				   data=setEvidenceListDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback(evidenceList,"#evidenceListForm",data);
		   	       }
			    }, 
			    function(tx, error) {
			    	message("获取证据保存清单及明细列表失败:"+ error.message);
		        });  
		});
	}
}

function findEvidenceListDetailByEvidenceListIdSetItemsOffLine(evidenceList,callback){
	var data = new Array();
	if(null==evidenceList){
		return;
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST_DETAIL WHERE CASE_EVIDENCELIST_ID = '+parseInt(evidenceList.id), [], function (tx, result){
				   data=setEvidenceListDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback("#evidenceTreatmentDecisionForm",data);
		   	       }
			    }, 
			    function(tx, error) {
			    	message("获取证据保存清单及明细列表失败:"+ error.message);
		        });  
		});
	}
}

/**
 * 获取离线证据保存清单列表,将列表值赋值给处理决定书中
 * @param caseBasicInfoId
 * @param callback
 */
function findEvidenceListDetailsByIdOffLine(caseBasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST WHERE CASE_BASICINFO_ID = '+parseInt(caseBasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取证据登记保存清单错误");
		    	return;
		    }
		    data = setEvidenceListOffLine(result);
		    findEvidenceListDetailByEvidenceListIdSetItemsOffLine(data[0],callback);
		    /*if(typeof(callback) == 'function'){
    	    	callback(data[0],"#evidenceListForm");
    	    }
		    return data[0];*/
	    }, 
	    function(tx, error) {
	    	message("证据登记保存清单不存在");
        });  
	});
}
/**
 * 通过案件ID 证据登记保存清单
 * @param casebasicInfoId
 * @param callback
 */
function findEvidenceListByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取证据登记保存清单错误");
		    	return;
		    }
		     data = setEvidenceListOffLine(result);
		     findEvidenceListDetailByEvidenceListIdOffLine(data[0],callback);
		    /*if(typeof(callback) == 'function'){
    	    	callback(data[0],"#evidenceListForm");
    	    }
		    return data[0];*/
		     return data[0];
	    }, 
	    function(tx, error) {
	    	message("证据登记保存清单不存在");
        });  
	});
}
/**
 * 通过证据登记保存清单ID获取 证据登记保存清单明细
 * @param caseBasicInfoId
 * @param callback
 */
function findAllEvidenceListDetailByIdOnLine(evidenceList,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryEvidenceListDetail",
		data : {
			id : evidenceList.id
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.evidenceListDetail,"#evidenceListDetailForm",evidenceList);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取证据登记保存清单书明细列表失败");
        }
	});
}



/**
 * 通过ID获取 证据登记保存清单明细
 * @param id
 * @param callback 
 */
function findEvidenceListDetailByIdOffLine(id,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST_DETAIL  WHERE CASE_EVIDENCELIST_DETAIL_ID = '+parseInt(id), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取证据登记保存清单明细错误");
		    	return;
		    }
		    data = setEvidenceListDetailDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#evidenceListDetailForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("证据登记保存清单明细不存在");
        });  
	});
}

/**
 * 获取抽样取证凭证明细列表
 */
function findSampleEvidenceDetailBySampleEvidenceIdOffLine(sampleEvidence,callback){
	var data = new Array();
	if(null==sampleEvidence){
		if(typeof(callback) == 'function'){
  	    	 callback(sampleEvidence,"#sampleEvidenceForm",data);
  	        }
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_SAMPLEEVIDENCE_DETAIL WHERE CASE_SAMPLEEVIDENCE_ID = '+parseInt(sampleEvidence.id), [], function (tx, result){
				   data=setSampleEvidenceDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback(sampleEvidence,"#sampleEvidenceForm",data);
		   	        }
			    }, 
			    function(tx, error) {
			    	message("获取抽样取证凭证及明细列表失败:"+ error.message);
		        });  
		});
	}
}


/**
 * 通过抽样取证凭证ID获取 抽样取证凭证明细
 * @param caseBasicInfoId
 * @param callback
 */
function findAllSampleEvidenceDetailByIdOnLine(sampleEvidence,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/querySampleEvidenceDetail",
		data : {
			id : sampleEvidence.id
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.sampleEvidenceDetail,"#sampleEvidenceForm",sampleEvidence);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取抽样取证凭证明细列表失败");
        }
	});
}

/**
 * 通过案件ID 抽样取证凭证
 * @param casebasicInfoId
 * @param callback
 */
function findSampleEvidenceByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SAMPLEEVIDENCE  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取抽样取证凭证错误");
		    	return;
		    }
		    data = setSampleEvidenceOffLine(result);
		    findSampleEvidenceDetailBySampleEvidenceIdOffLine(data[0],callback);
		    
		   /* if(typeof(callback) == 'function'){
    	    	callback(data[0],"#sampleEvidenceForm");
    	    }
		    return data[0];*/
		    return data[0];
	    },
	    function(tx, error) {
	    	message("获取抽样取证凭证及明细列表失败");
        });  
	});
}

/**
 * 通过ID获取 抽样取证凭证明细
 * @param id
 * @param callback 
 */
function findSampleEvidenceDetailByIdOffLine(id,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SAMPLEEVIDENCE_DETAIL  WHERE CASE_SAMPLEEVIDENCE_DETAIL_ID = '+parseInt(id), [], function (tx,result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取抽样取证凭证明细错误");
		    	return;
		    }
		    data = setSampleEvidenceDetailDataOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#sampleEvidenceDetailForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("证据抽样取证凭证明细不存在");
        });  
	});
}


/**
 * 通过ID 获取卷内目录
 * @param casebasicInfoId
 * @param callback
 */
function findFileListByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_FILELIST  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取卷内目录错误");
		    	return;
		    }
		    data = setFileListOffLine(result);
		    findFileListDetailByFileListIdOffLine(data[0],callback);
		    
		   /* if(typeof(callback) == 'function'){
    	    	callback(data[0],"#sampleEvidenceForm");
    	    }
		    return data[0];*/
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("获取卷内目录列表失败");
        });
	});
}

/**
 * 通过ID 获取卷宗目录
 * @param casebasicInfoId
 * @param callback
 */
function findFileClanListByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_FILECLANLIST  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
			if(len > 1){
				message("获取卷宗目录错误");
				return;
			}
			data = setFileClanListOffLine(result);
			findFileClanListDetailByFileClanListIdOffLine(data[0],callback);
			
			/* if(typeof(callback) == 'function'){
    	    	callback(data[0],"#sampleEvidenceForm");
    	    }
		    return data[0];*/
			return data[0];
		}, 
		function(tx, error) {
			message("获取卷宗目录列表失败");
		});
	});
}

/**
 * 通过卷内目录 卷内目录详情
 * @param fileList
 * @param callback
 */
function findFileListDetailByFileListIdOffLine(fileList,callback){
	var data = new Array();
	if(null==fileList){
		if(typeof(callback) == 'function'){
  	    	 callback(fileList,"#fileListForm",data);
  	        }
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_FILELIST_DETAIL WHERE CASE_FILELIST_ID = '+parseInt(fileList.id), [], function (tx, result){
				   data=setFileListDetailDataOffLine(result);
				   if(typeof(callback) == 'function'){
		   	    	 callback(fileList,"#fileListForm",data);
		   	        }
			    }, 
			    function(tx, error) {
			    	message("获取卷内目录列表失败:"+ error.message);
		        });  
		});
	}
}

/**
 * 通过卷内目录 卷宗目录详情
 * @param fileClanList
 * @param callback
 */
function findFileClanListDetailByFileClanListIdOffLine(fileClanList,callback){
	var data = new Array();
	if(null==fileClanList){
		if(typeof(callback) == 'function'){
			callback(fileClanList,"#fileClanListForm",data);
		}
	}else{
		db.transaction(function (tx) { 
			tx.executeSql('SELECT * FROM CASE_DOCU_FILECLANLIST_DETAIL WHERE CASE_FILECLANLIST_ID = '+parseInt(fileClanList.id), [], function (tx, result){
				data=setFileClanListDetailDataOffLine(result);
				if(typeof(callback) == 'function'){
					callback(fileClanList,"#fileClanListForm",data);
				}
			}, 
			function(tx, error) {
				message("获取卷宗目录列表失败:"+ error.message);
			});  
		});
	}
}

/**
 * 通过案件ID 暂扣凭证
 * @param casebasicInfoId
 * @param callback
 */
function findWithholdCertificateByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_WITHHOLDCERTIFICATE  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取暂扣凭证错误");
		    	return;
		    }
		    data = setWithholdCertificateOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#withholdCertificateForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("暂扣凭证不存在");
        });  
	});
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAdminEnforceApplicationDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var adminEnforceApplication ={};
		adminEnforceApplication.id=result.rows.item(i).CASE_ADMINENFORCEAPPLICATION_ID;
		adminEnforceApplication.createTime=result.rows.item(i).CREATE_TIME;
		adminEnforceApplication.modifyTime=result.rows.item(i).MODIFY_TIME;
		adminEnforceApplication.caseIdWord=result.rows.item(i).CASEID_WORD;
		adminEnforceApplication.caseIdYear=result.rows.item(i).CASEID_YEAR;
		adminEnforceApplication.caseIdNo=result.rows.item(i).CASEID_NO;
		adminEnforceApplication.court=result.rows.item(i).COURT;
		adminEnforceApplication.punishYear=result.rows.item(i).PUNISH_YEAR;
		adminEnforceApplication.punishMonth=result.rows.item(i).PUNISH_MONTH;
		adminEnforceApplication.punishDay=result.rows.item(i).PUNISH_DAY;
		adminEnforceApplication.party=result.rows.item(i).PARTY;
		adminEnforceApplication.punishDecision=result.rows.item(i).PUNISH_DECISION;
		adminEnforceApplication.punishDecisionCapital=result.rows.item(i).PUNISH_DECISION_CAPITAL;
		adminEnforceApplication.caseNumber=result.rows.item(i).FILENO;
		adminEnforceApplication.basicInfo=result.rows.item(i).BASIC_INFO;
		adminEnforceApplication.attachmentFiles=result.rows.item(i).ATTACHMENT_FILES;
		adminEnforceApplication.makeDate=result.rows.item(i).MAKE_DATE;
		adminEnforceApplication.organContactor=result.rows.item(i).ORGAN_CONTACTOR;
		adminEnforceApplication.organTel=result.rows.item(i).ORGAN_TEL;
	    data.push(adminEnforceApplication);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAssistInvestDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var assistInvest ={};
		assistInvest.id=result.rows.item(i).CASE_ASSISTINVEST_ID;
		assistInvest.createTime=result.rows.item(i).CREATE_TIME;
		assistInvest.modifyTime=result.rows.item(i).MODIFY_TIME;
		assistInvest.assistUnit=result.rows.item(i).ASSIST_UNIT;
		assistInvest.caseIdWord=result.rows.item(i).CASEID_WORD;
		assistInvest.caseIdYear=result.rows.item(i).CASEID_YEAR;
		assistInvest.caseIdNo=result.rows.item(i).CASEID_NO;
		assistInvest.caseName=result.rows.item(i).CASE_NAME;
		assistInvest.contactor=result.rows.item(i).CONTACTOR;
		assistInvest.tel=result.rows.item(i).TEL;
		assistInvest.investTime=result.rows.item(i).INVEST_TIME;
		assistInvest.madeDate=result.rows.item(i).MADE_DATE;
	    data.push(assistInvest);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAvoidApplyDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var avoidApply ={};
		avoidApply.id=result.rows.item(i).CASE_AVOIDAPPLY_ID;
		avoidApply.createTime=result.rows.item(i).CREATE_TIME;
		avoidApply.modifyTime=result.rows.item(i).MODIFY_TIME;
		avoidApply.party=result.rows.item(i).PARTY;
		avoidApply.partyTel=result.rows.item(i).PARTY_TEL;
		avoidApply.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		avoidApply.respondent=result.rows.item(i).RESPONDENT;
		avoidApply.respondentUnitPosition=result.rows.item(i).RESPONDENT_UNIT_POSITION;
		avoidApply.applyReason=result.rows.item(i).APPLY_REASON;
		avoidApply.organName=result.rows.item(i).ORGAN_NAME;
		avoidApply.makeDate=result.rows.item(i).MAKE_DATE;
		var time=result.rows.item(i).MAKE_DATE;
		if($.trim(time).length !=0){
			var timearr=time.replace(" ",":").replace(/\:/g,"-").split("-"); 
			avoidApply.applyYear=timearr[0];
			avoidApply.applyMonth=timearr[1];
			avoidApply.applyDay=timearr[2];
		}
	    data.push(avoidApply);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAvoidApplyAgreeDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var avoidApplyAgree ={};
		avoidApplyAgree.id=result.rows.item(i).CASE_AVOIDAPPLYAGREE_ID;
		avoidApplyAgree.createTime=result.rows.item(i).CREATE_TIME;
		avoidApplyAgree.modifyTime=result.rows.item(i).MODIFY_TIME;
		avoidApplyAgree.party=result.rows.item(i).PARTY;
		avoidApplyAgree.partyTel=result.rows.item(i).PARTY_TEL;
		avoidApplyAgree.respondent=result.rows.item(i).RESPONDENT;
		avoidApplyAgree.respondentUnitPosition=result.rows.item(i).RESPONDENT_UNIT_POSITION;
		avoidApplyAgree.applyYear=result.rows.item(i).APPLY_YEAR;
		avoidApplyAgree.applyMonth=result.rows.item(i).APPLY_MONTH;
		avoidApplyAgree.applyDay=result.rows.item(i).APPLY_DAY;
		avoidApplyAgree.applyReason=result.rows.item(i).APPLY_REASON;
		avoidApplyAgree.caseName=result.rows.item(i).CASE_NAME;
		avoidApplyAgree.lawName=result.rows.item(i).LAW_NAME;
		avoidApplyAgree.article=result.rows.item(i).ARTICLE;
		avoidApplyAgree.clause=result.rows.item(i).CLAUSE;
		avoidApplyAgree.item=result.rows.item(i).ITEM;
		avoidApplyAgree.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(avoidApplyAgree);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setCaseProcessIdeaOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var caseProcessIdea ={};
		caseProcessIdea.id=result.rows.item(i).CASE_CASEPROCESSIDEA_ID;
		caseProcessIdea.createTime=result.rows.item(i).CREATE_TIME;
		caseProcessIdea.modifyTime=result.rows.item(i).MODIFY_TIME;
		caseProcessIdea.caseName=result.rows.item(i).CASE_NAME;
		caseProcessIdea.caseInvestigators=result.rows.item(i).CASE_INVESTIGATORS;
		caseProcessIdea.party=result.rows.item(i).PARTY;
		caseProcessIdea.partyType=result.rows.item(i).PARTY_TYPE;
		caseProcessIdea.partySex=result.rows.item(i).PARTY_SEX;
		caseProcessIdea.partyAge=result.rows.item(i).PARTY_AGE;
		caseProcessIdea.partyTel=result.rows.item(i).PARTY_TEL;
		caseProcessIdea.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		caseProcessIdea.partyJob=result.rows.item(i).PARTY_JOB;
		caseProcessIdea.partyManager=result.rows.item(i).PARTY_MANAGER;
		caseProcessIdea.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		caseProcessIdea.caseProcessIllegalFacts=result.rows.item(i).CASE_PROCESS_ILLEGAL_FACTS;
		caseProcessIdea.investResultProcessIdea=result.rows.item(i).INVEST_RESULT_PROCESS_IDEA;
		caseProcessIdea.staffSignatureDate=result.rows.item(i).STAFF_SIGNATURE_DATE;
		caseProcessIdea.auditOpinion=result.rows.item(i).AUDIT_OPINION;
		caseProcessIdea.auditSignatureDate=result.rows.item(i).AUDIT_SIGNATURE_DATE;
		caseProcessIdea.lawOrganOpinion=result.rows.item(i).LAW_ORGAN_OPINION;
		caseProcessIdea.lawOrganSignatureDate=result.rows.item(i).LAW_ORGAN_SIGNATURE_DATE;
	    data.push(caseProcessIdea);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAvoidApplyRejectDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var avoidApplyReject ={};
		avoidApplyReject.id=result.rows.item(i).CASE_AVOIDAPPLYREJECT_ID;
		avoidApplyReject.createTime=result.rows.item(i).CREATE_TIME;
		avoidApplyReject.modifyTime=result.rows.item(i).MODIFY_TIME;
		avoidApplyReject.party=result.rows.item(i).PARTY;
		avoidApplyReject.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		avoidApplyReject.respondent=result.rows.item(i).RESPONDENT;
		avoidApplyReject.respondentUnitPosition=result.rows.item(i).RESPONDENT_UNIT_POSITION;
		avoidApplyReject.applyYear=result.rows.item(i).APPLY_YEAR;
		avoidApplyReject.applyMonth=result.rows.item(i).APPLY_MONTH;
		avoidApplyReject.applyDay=result.rows.item(i).APPLY_DAY;
		avoidApplyReject.applyReason=result.rows.item(i).APPLY_REASON;
		avoidApplyReject.caseName=result.rows.item(i).CASE_NAME;
		avoidApplyReject.lawName=result.rows.item(i).LAW_NAME;
		avoidApplyReject.article=result.rows.item(i).ARTICLE;
		avoidApplyReject.clause=result.rows.item(i).CLAUSE;
		avoidApplyReject.item=result.rows.item(i).ITEM;
		avoidApplyReject.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(avoidApplyReject);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setDelayPayfineApplyOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var delayPayfineApply ={};
		delayPayfineApply.id=result.rows.item(i).CASE_DELAYPAYFINEAPPLY_ID;
		delayPayfineApply.createTime=result.rows.item(i).CREATE_TIME;
		delayPayfineApply.modifyTime=result.rows.item(i).MODIFY_TIME;
		delayPayfineApply.caseName=result.rows.item(i).CASE_NAME;
		delayPayfineApply.caseNumber=result.rows.item(i).FILENO;
		delayPayfineApply.party=result.rows.item(i).PARTY;
		delayPayfineApply.partyTel=result.rows.item(i).PARTY_CONTACT_INFOMATION;
		delayPayfineApply.illegalFactsPunishDecision=result.rows.item(i).ILLEGAL_FACTS_PUNISH_DECISION;
		delayPayfineApply.reason=result.rows.item(i).REASON;
		delayPayfineApply.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		var time=result.rows.item(i).SIGNATURE_DATE_1;
		if($.trim(time).length !=0){
			var timearr=time.replace(" ",":").replace(/\:/g,"-").split("-"); 
			delayPayfineApply.applyYear=timearr[0];
			delayPayfineApply.applyMonth=timearr[1];
			delayPayfineApply.applyDay=timearr[2];
		}
		delayPayfineApply.staffOpinion=result.rows.item(i).STAFF_OPINION;
		delayPayfineApply.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
		delayPayfineApply.lawOrganOpinion=result.rows.item(i).LAW_ORGAN_OPINION;
		delayPayfineApply.signatureDate3=result.rows.item(i).SIGNATURE_DATE_3;
	    data.push(delayPayfineApply);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setDelayPayfineApplyAgreeOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var delayPayfineApplyAgree ={};
		delayPayfineApplyAgree.id=result.rows.item(i).CASE_DELAYPAYFINEAPPLYAGREE_ID;
		delayPayfineApplyAgree.createTime=result.rows.item(i).CREATE_TIME;
		delayPayfineApplyAgree.modifyTime=result.rows.item(i).MODIFY_TIME;
		delayPayfineApplyAgree.party=result.rows.item(i).PARTY;
		delayPayfineApplyAgree.deliveryYear=result.rows.item(i).DELIVERY_YEAR;
		delayPayfineApplyAgree.deliveryMonth=result.rows.item(i).DELIVERY_MONTH;
		delayPayfineApplyAgree.deliveryDay=result.rows.item(i).DELIVERY_DAY;
		delayPayfineApplyAgree.caseNumber=result.rows.item(i).FILENO;
		delayPayfineApplyAgree.punishAmount=result.rows.item(i).PUNISH_AMOUNT;
		delayPayfineApplyAgree.delayOrStage=result.rows.item(i).DELAY_OR_STAGE;
		delayPayfineApplyAgree.delayToYear=result.rows.item(i).DELAY_TO_YEAR;
		delayPayfineApplyAgree.delayToMonth=result.rows.item(i).DELAY_TO_MONTH;
		delayPayfineApplyAgree.delayToDay=result.rows.item(i).DELAY_TO_DAY;
		delayPayfineApplyAgree.stageNo=result.rows.item(i).STAGE_NO;
		delayPayfineApplyAgree.stageToYear=result.rows.item(i).STAGE_TO_YEAR;
		delayPayfineApplyAgree.stageToMonth=result.rows.item(i).STAGE_TO_MONTH;
		delayPayfineApplyAgree.stageToDay=result.rows.item(i).STAGE_TO_DAY;
		delayPayfineApplyAgree.stageAmount=result.rows.item(i).STAGE_AMOUNT;
		delayPayfineApplyAgree.notYetPaidAmount=result.rows.item(i).NOT_YET_PAID_AMOUNT;
		delayPayfineApplyAgree.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(delayPayfineApplyAgree);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setDocumentReceiptDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var documentReceiptDetail = {};
		documentReceiptDetail.id = result.rows.item(i).CASE_DOCUMENTRECEIPT_DETAIL_ID;
		documentReceiptDetail.createTime=result.rows.item(i).CREATE_TIME;
		documentReceiptDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		documentReceiptDetail.documentNameNo = result.rows.item(i).DOCUMENT_NAME_NO;
		documentReceiptDetail.signature = result.rows.item(i).DOCUMENT_SIGNATURE;
		documentReceiptDetail.deliveryPlace = result.rows.item(i).DELIVERY_PLACE;
		documentReceiptDetail.deliveryType = result.rows.item(i).DELIVERY_TYPE;
		documentReceiptDetail.processServer   = result.rows.item(i).PROCESS_SERVER;
	    data.push(documentReceiptDetail);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setEntrustIdentifyOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var entrustIdentify ={};
		entrustIdentify.id=result.rows.item(i).CASE_ENTRUSTIDENTIFY_ID;
		entrustIdentify.createTime=result.rows.item(i).CREATE_TIME;
		entrustIdentify.modifyTime=result.rows.item(i).MODIFY_TIME;
		entrustIdentify.entrustedUnit=result.rows.item(i).ENTRUSTED_UNIT;
		entrustIdentify.identificationRequirements=result.rows.item(i).IDENTIFICATION_REQUIREMENTS;
		entrustIdentify.beforeDate=result.rows.item(i).BEFORE_DATE;
		entrustIdentify.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(entrustIdentify);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setEntrustIdentifyDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var entrustIdentifyDetail = {};
		entrustIdentifyDetail.id = result.rows.item(i).CASE_ENTRUSTIDENTIFY_DETAIL_ID;
		entrustIdentifyDetail.createTime=result.rows.item(i).CREATE_TIME;
		entrustIdentifyDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		entrustIdentifyDetail.itemName = result.rows.item(i).ITEM_NAME;
		entrustIdentifyDetail.specModel = result.rows.item(i).SPEC_MODEL;
		entrustIdentifyDetail.amount = result.rows.item(i).AMOUNT;
		entrustIdentifyDetail.note   = result.rows.item(i).NOTE;
	    data.push(entrustIdentifyDetail);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setEvidenceListOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var evidenceList ={};
		evidenceList.id=result.rows.item(i).CASE_EVIDENCELIST_ID;
		evidenceList.createTime=result.rows.item(i).CREATE_TIME;
		evidenceList.modifyTime=result.rows.item(i).MODIFY_TIME;
		evidenceList.party=result.rows.item(i).PARTY;
		evidenceList.partyType=result.rows.item(i).PARTY_TYPE;
		evidenceList.partySex=result.rows.item(i).PARTY_SEX;
		evidenceList.partyAge=result.rows.item(i).PARTY_AGE;
		evidenceList.partyTel=result.rows.item(i).PARTY_TEL;
		evidenceList.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		evidenceList.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		evidenceList.partyZipCode=result.rows.item(i).PARTY_ZIPCODE;
		evidenceList.partyJob=result.rows.item(i).PARTY_JOB;
		evidenceList.partyManager=result.rows.item(i).PARTY_MANAGER;
		evidenceList.acceptTreatmentPerson=result.rows.item(i).ACCEPT_TREATMENT_PERSON;
		evidenceList.acceptTreatmentAddress=result.rows.item(i).ACCEPT_TREATMENT_ADDRESS;
		evidenceList.acceptTreatmentDate=result.rows.item(i).ACCEPT_TREATMENT_DATE;
		evidenceList.signtureDate=result.rows.item(i).SIGNATURE_DATE;
		evidenceList.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		evidenceList.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		evidenceList.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(evidenceList);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setCaseProcessIdeaDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var caseProcessIdeaDetail = {};
		caseProcessIdeaDetail.id = result.rows.item(i).CASE_CASEPROCESSIDEA_DETAIL_ID;
		caseProcessIdeaDetail.createTime=result.rows.item(i).CREATE_TIME;
		caseProcessIdeaDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		caseProcessIdeaDetail.evidenceNo = result.rows.item(i).EVIDENCE_NO;
		caseProcessIdeaDetail.itemName = result.rows.item(i).ITEM_NAME;
		caseProcessIdeaDetail.specModel = result.rows.item(i).SPEC_MODEL;
		caseProcessIdeaDetail.amount   = result.rows.item(i).AMOUNT;
	    data.push(caseProcessIdeaDetail);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setEvidenceListDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var evidenceListDetail = {};
		evidenceListDetail.id = result.rows.item(i).CASE_EVIDENCELIST_DETAIL_ID;
		evidenceListDetail.createTime=result.rows.item(i).CREATE_TIME;
		evidenceListDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		evidenceListDetail.evidenceNo = result.rows.item(i).EVIDENCE_NO;
		evidenceListDetail.evidenceName = result.rows.item(i).EVIDENCE_NAME;
		evidenceListDetail.spec = result.rows.item(i).SPEC;
		evidenceListDetail.amount = result.rows.item(i).AMOUNT;
		evidenceListDetail.savePlace  = result.rows.item(i).SAVE_PLACE;
	    data.push(evidenceListDetail);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setEvidenceTreatmentDecisionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var evidenceTreatmentDecision ={};
		evidenceTreatmentDecision.id=result.rows.item(i).CASE_EVIDENCETREATMENTDECISION_ID;
		evidenceTreatmentDecision.createTime=result.rows.item(i).CREATE_TIME;
		evidenceTreatmentDecision.modifyTime=result.rows.item(i).MODIFY_TIME;
		evidenceTreatmentDecision.caseIdWord=result.rows.item(i).CASEID_WORD;
		evidenceTreatmentDecision.caseIdYear=result.rows.item(i).CASEID_YEAR;
		evidenceTreatmentDecision.caseIdNo=result.rows.item(i).CASEID_NO;
		evidenceTreatmentDecision.party=result.rows.item(i).PARTY;
		evidenceTreatmentDecision.savingItems=result.rows.item(i).SAVING_ITEMS;
		evidenceTreatmentDecision.treatmentDecision=result.rows.item(i).TREATMENT_DECISION;
		evidenceTreatmentDecision.savingYear=result.rows.item(i).SAVING_YEAR;
		evidenceTreatmentDecision.savingMonth=result.rows.item(i).SAVING_MONTH;
		evidenceTreatmentDecision.savingDay=result.rows.item(i).SAVING_DAY;
		evidenceTreatmentDecision.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(evidenceTreatmentDecision);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFillingApproveDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var fillingApprove ={};
		fillingApprove.id=result.rows.item(i).CASE_FILLINGAPPROVE_ID;
		fillingApprove.createTime=result.rows.item(i).CREATE_TIME;
		fillingApprove.modifyTime=result.rows.item(i).MODIFY_TIME;
		fillingApprove.caseIdWord=result.rows.item(i).CASEID_WORD;
		fillingApprove.caseIdYear=result.rows.item(i).CASEID_YEAR;
		fillingApprove.caseIdNo=result.rows.item(i).CASEID_NO;
		fillingApprove.acceptTime=result.rows.item(i).ACCEPT_TIME;
		fillingApprove.caseSource=result.rows.item(i).CASE_SOURCE;
		fillingApprove.caseName=result.rows.item(i).CASE_NAME;
		fillingApprove.partyType=result.rows.item(i).PARTY_TYPE;
		fillingApprove.party=result.rows.item(i).PARTY;
		fillingApprove.partySex=result.rows.item(i).PARTY_SEX;
		fillingApprove.partyAge=result.rows.item(i).PARTY_AGE;
		fillingApprove.partyTel=result.rows.item(i).PARTY_TEL;
		fillingApprove.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		fillingApprove.partyUnitPosition=result.rows.item(i).PARTY_UNIT_POSITION;
		fillingApprove.partyManager=result.rows.item(i).PARTY_MANAGER;
		fillingApprove.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		fillingApprove.baseInfo=result.rows.item(i).BASE_INFO;
		fillingApprove.illegalLaw=result.rows.item(i).ILLEGAL_LAW;
		fillingApprove.acceptOrganView=result.rows.item(i).ACCEPT_ORGAN_VIEW;
		fillingApprove.accrptOrganTime=result.rows.item(i).ACCEPT_ORGAN_TIME;
		fillingApprove.approvalView=result.rows.item(i).APPROVAL_VIEW;
		fillingApprove.approvalTime=result.rows.item(i).APPROVAL_TIME;
		fillingApprove.note=result.rows.item(i).NOTE;
	    data.push(fillingApprove);
    }
	return data;
}
/**
* 组装数据list
* @param result
* @returns {Array}
*/
function setHearingBulletinDataOffLine(result){
	var len = result.rows.length;
   var data = new Array();
	for (var i = 0; i < len; i++){
		var hearingBulletin ={};
		hearingBulletin.id=result.rows.item(i).CASE_HEARINGBULLETIN_ID;
		hearingBulletin.createTime=result.rows.item(i).CREATE_TIME;
		hearingBulletin.modifyTime=result.rows.item(i).MODIFY_TIME;
		hearingBulletin.caseIdWord=result.rows.item(i).CASEID_WORD;
		hearingBulletin.caseIdYear=result.rows.item(i).CASEID_YEAR;
		hearingBulletin.caseIdNo=result.rows.item(i).CASEID_NO;
		hearingBulletin.lawName=result.rows.item(i).LAW_NAME;
		hearingBulletin.heargingYear=result.rows.item(i).HEARGING_YEAR;
		hearingBulletin.heargingMonth=result.rows.item(i).HEARGING_MONTH;
		hearingBulletin.heargingDay=result.rows.item(i).HEARGING_DAY;
		hearingBulletin.heargingHour=result.rows.item(i).HEARGING_HOUR;
		hearingBulletin.hearingPlace=result.rows.item(i).HEARING_PLACE;
		hearingBulletin.applyYear=result.rows.item(i).APPLY_YEAR;
		hearingBulletin.applyMonth=result.rows.item(i).APPLY_MONTH;
		hearingBulletin.applyDay=result.rows.item(i).APPLY_DAY;
		hearingBulletin.hearingOrgan=result.rows.item(i).HEARING_ORGAN;
		hearingBulletin.signupStartYear=result.rows.item(i).SIGNUP_START_YEAR;
		hearingBulletin.signupStartMonth=result.rows.item(i).SIGNUP_START_MONTH;
		hearingBulletin.signupStartDay=result.rows.item(i).SIGNUP_START_DAY;
		hearingBulletin.signupEndMonth=result.rows.item(i).SIGNUP_END_MONTH;
		hearingBulletin.signupEndDay=result.rows.item(i).SIGNUP_END_DAY;
		hearingBulletin.workingStartHour=result.rows.item(i).WORKING_START_HOUR;
		hearingBulletin.workingEndHour=result.rows.item(i).WORKING_END_HOUR;
		hearingBulletin.idcardLetter=result.rows.item(i).IDCARD_LETTER;
		hearingBulletin.signupPlace=result.rows.item(i).SIGNUP_PLACE;
		hearingBulletin.conditions=result.rows.item(i).CONDITIONS;
		hearingBulletin.attentions=result.rows.item(i).ATTENTIONS;
		hearingBulletin.organContactor=result.rows.item(i).ORGAN_CONTACTOR;
		hearingBulletin.organTel=result.rows.item(i).ORGAN_TEL;
		hearingBulletin.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(hearingBulletin);
   }
	return data;
}
/**
* 组装数据list
* @param result
* @returns {Array}
*/
function setHearingEntrustDataOffLine(result){
	var len = result.rows.length;
   var data = new Array();
	for (var i = 0; i < len; i++){
		var hearingEntrust ={};
		hearingEntrust.id=result.rows.item(i).CASE_HEARINGENTRUST_ID;
		hearingEntrust.createTime=result.rows.item(i).CREATE_TIME;
		hearingEntrust.modifyTime=result.rows.item(i).MODIFY_TIME;
		hearingEntrust.entruster=result.rows.item(i).ENTRUSTER;
		hearingEntrust.entrusterSex=result.rows.item(i).ENTRUSTER_SEX;
		hearingEntrust.entrusterPosition=result.rows.item(i).ENTRUSTER_POSITION;
		hearingEntrust.entrusterUnit=result.rows.item(i).ENTRUSTER_UNIT;
		hearingEntrust.entrusterTel=result.rows.item(i).ENTRUSTER_TEL;
		hearingEntrust.entrusterAddress=result.rows.item(i).ENTRUSTER_ADDRESS;
		hearingEntrust.entrusterZipCode=result.rows.item(i).ENTRUSTER_ZIPCODE;
		hearingEntrust.proxy=result.rows.item(i).PROXY;
		hearingEntrust.proxySex=result.rows.item(i).PROXY_SEX;
		hearingEntrust.proxyPosition=result.rows.item(i).PROXY_POSITION;
		hearingEntrust.proxyUnit=result.rows.item(i).PROXY_UNIT;
		hearingEntrust.proxyTel=result.rows.item(i).PROXY_TEL;
		hearingEntrust.proxyAddress=result.rows.item(i).PROXY_ADDRESS;
		hearingEntrust.proxyZipCode=result.rows.item(i).ENTRUSTER_ZIPCODE;
		hearingEntrust.caseName=result.rows.item(i).CASE_NAME;
		hearingEntrust.proxyPermissions=result.rows.item(i).PROXY_PERMISSIONS;
		hearingEntrust.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		hearingEntrust.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
	    data.push(hearingEntrust);
   }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setHearingNotesDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var hearingNotes ={};
		hearingNotes.id=result.rows.item(i).CASE_HEARINGNOTES_ID;
		hearingNotes.createTime=result.rows.item(i).CREATE_TIME;
		hearingNotes.modifyTime=result.rows.item(i).MODIFY_TIME;
		hearingNotes.caseName=result.rows.item(i).CASE_NAME;
		hearingNotes.hearingOrgan=result.rows.item(i).HEARING_ORGAN;
		hearingNotes.hearingPlace=result.rows.item(i).HEARING_PLACE;
		hearingNotes.hearingStartYear=result.rows.item(i).HEARGING_START_YEAR;
		hearingNotes.hearingStartMonth=result.rows.item(i).HEARGING_START_MONTH;
		hearingNotes.hearingStartDay=result.rows.item(i).HEARGING_START_DAY;
		hearingNotes.hearingStartHour=result.rows.item(i).HEARGING_START_HOUR;
		hearingNotes.hearingStartMinute=result.rows.item(i).HEARGING_START_MINUTE;
		hearingNotes.hearingEndYear=result.rows.item(i).HEARGING_END_YEAR;
		hearingNotes.hearingEndMonth=result.rows.item(i).HEARGING_END_MONTH;
		hearingNotes.hearingEndDay=result.rows.item(i).HEARGING_END_DAY;
		hearingNotes.hearingEndHour=result.rows.item(i).HEARGING_END_HOUR;
		hearingNotes.hearingEndMinute=result.rows.item(i).HEARGING_END_MINUTE;
		hearingNotes.persidingHearer=result.rows.item(i).PRESIDING_HEARER;
		hearingNotes.hearingOfficer=result.rows.item(i).HEARING_OFFICER;
		hearingNotes.hearingClerks=result.rows.item(i).HEARING_CLERKS;
		hearingNotes.staff1=result.rows.item(i).STAFF_1;
		hearingNotes.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		hearingNotes.staff2=result.rows.item(i).STAFF_2;
		hearingNotes.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		hearingNotes.party=result.rows.item(i).PARTY;
		hearingNotes.partyManager=result.rows.item(i).PARTY_MANAGER;
		hearingNotes.partyTel=result.rows.item(i).PARTY_TEL;
		hearingNotes.proxy=result.rows.item(i).PROXY;
		hearingNotes.proxySex=result.rows.item(i).PROXY_SEX;
		hearingNotes.proxyAge=result.rows.item(i).PROXY_AGE;
		hearingNotes.proxyUnitPosition=result.rows.item(i).PROXY_UNIT_POSITION;
		hearingNotes.thirdParty=result.rows.item(i).THIRD_PARTY;
		hearingNotes.thirdPartySex=result.rows.item(i).THIRD_PARTY_SEX;
		hearingNotes.thirdPartyAge=result.rows.item(i).THIRD_PARTY_AGE;
		hearingNotes.thirdPartyUnitPosition=result.rows.item(i).THIRD_PARTY_UNIT_POSITION;
		hearingNotes.otherPariticipants=result.rows.item(i).OTHER_PARTICIPANTS;
		hearingNotes.otherPariticipantsSex=result.rows.item(i).OTHER_PARTICIPANTS_SEX;
		hearingNotes.otherPariticipantsAge=result.rows.item(i).OTHER_PARTICIPANTS_AGE;
		hearingNotes.otherPariticipantsUnitPosition=result.rows.item(i).OTHER_PARTICIPANTS_UNIT_POSITION;
		hearingNotes.hearingRecord=result.rows.item(i).HEARING_RECORD;
		hearingNotes.signatureDate=result.rows.item(i).SIGNATURE_DATE;
		hearingNotes.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(hearingNotes);
    }
	return data;
}
/**
* 组装数据list
* @param result
* @returns {Array}
*/
function setHearingNoticeDataOffLine(result){
	var len = result.rows.length;
   var data = new Array();
	for (var i = 0; i < len; i++){
		var hearingNotice ={};
		hearingNotice.id=result.rows.item(i).CASE_HEARINGNOTICE_ID;
		hearingNotice.createTime=result.rows.item(i).CREATE_TIME;
		hearingNotice.modifyTime=result.rows.item(i).MODIFY_TIME;
		hearingNotice.caseIdWord=result.rows.item(i).CASEID_WORD;
		hearingNotice.caseIdYear=result.rows.item(i).CASEID_YEAR;
		hearingNotice.caseIdNo=result.rows.item(i).CASEID_NO;
		hearingNotice.party=result.rows.item(i).PARTY;
		hearingNotice.caseName=result.rows.item(i).CASE_NAME;
		hearingNotice.heargingYear=result.rows.item(i).HEARGING_YEAR;
		hearingNotice.heargingMonth=result.rows.item(i).HEARGING_MONTH;
		hearingNotice.heargingDay=result.rows.item(i).HEARGING_DAY;
		hearingNotice.heargingHour=result.rows.item(i).HEARGING_HOUR;
		hearingNotice.heargingMinute=result.rows.item(i).HEARGING_MINUTE;
		hearingNotice.hearingPlace=result.rows.item(i).HEARING_PLACE;
		hearingNotice.presidingHearer=result.rows.item(i).PRESIDING_HEARER;
		hearingNotice.presidingHearerPosition=result.rows.item(i).PRESIDING_HEARER_POSITION;
		hearingNotice.hearingOfficer1=result.rows.item(i).HEARING_OFFICER_1;
		hearingNotice.hearingOfficer1Position=result.rows.item(i).HEARING_OFFICER_1_POSITION;
		hearingNotice.hearingOfficer2=result.rows.item(i).HEARING_OFFICER_2;
		hearingNotice.hearingOfficer2Position=result.rows.item(i).HEARING_OFFICER_2_POSITION;
		hearingNotice.hearingClerks=result.rows.item(i).HEARING_CLERKS;
		hearingNotice.hearingClerksPosition=result.rows.item(i).HEARING_CLERKS_POSITION;
		hearingNotice.organAddress=result.rows.item(i).ORGAN_ADDRESS;
		hearingNotice.organZipCode=result.rows.item(i).ORGAN_ZIPCODE;
		hearingNotice.organContactor=result.rows.item(i).ORGAN_CONTACTOR;
		hearingNotice.organTel=result.rows.item(i).ORGAN_TEL;
		hearingNotice.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(hearingNotice);
   }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setHearingReportDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var hearingReport ={};
		hearingReport.id=result.rows.item(i).CASE_HEARINGREPORT_ID;
		hearingReport.createTime=result.rows.item(i).CREATE_TIME;
		hearingReport.modifyTime=result.rows.item(i).MODIFY_TIME;
		hearingReport.caseName=result.rows.item(i).CASE_NAME;
		hearingReport.persidingHearer=result.rows.item(i).PRESIDING_HEARER;
		hearingReport.hearingOfficer=result.rows.item(i).HEARING_OFFICER;
		hearingReport.hearingClerks=result.rows.item(i).HEARING_CLERKS;
		hearingReport.basicInfo=result.rows.item(i).BASIC_INFO;
		hearingReport.hearingConclusionsAdvice=result.rows.item(i).HEARING_CONCLUSIONS_ADVICE;
		hearingReport.lawOrganOpinion=result.rows.item(i).LAW_ORGAN_OPINION;
		hearingReport.persidingHearerSignatureDate=result.rows.item(i).PRESIDING_HEARER_SIGNATURE_DATE;
		hearingReport.signatureDate=result.rows.item(i).SIGNATURE_DATE;
	    data.push(hearingReport);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setIdentifyOpinionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var identifyOpinion ={};
		identifyOpinion.id=result.rows.item(i).CASE_IDENTIFYOPINION_ID;
		identifyOpinion.createTime=result.rows.item(i).CREATE_TIME;
		identifyOpinion.modifyTime=result.rows.item(i).MODIFY_TIME;
		identifyOpinion.contentPurpose=result.rows.item(i).CONTENT_PURPOSE;
		identifyOpinion.entrustUnit=result.rows.item(i).ENTRUST_UNIT;
		identifyOpinion.identifyPerson=result.rows.item(i).IDENTIFY_PERSON;
		identifyOpinion.positionJobTitle=result.rows.item(i).POSITION_JOBTITLE;
		identifyOpinion.identifyPlace=result.rows.item(i).IDENTIFY_PLACE;
		identifyOpinion.identifyOpinion=result.rows.item(i).IDENTIFY_OPINION;
		identifyOpinion.identifyDate=result.rows.item(i).IDENTIFY_DATE;
		identifyOpinion.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(identifyOpinion);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setIllegalActionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var illegalAction ={};
		illegalAction.id=result.rows.item(i).CASE_ILLEGALACTION_ID;
		illegalAction.createTime=result.rows.item(i).CREATE_TIME;
		illegalAction.modifyTime=result.rows.item(i).MODIFY_TIME;
		illegalAction.caseIdWord=result.rows.item(i).CASEID_WORD;
		illegalAction.caseIdYear=result.rows.item(i).CASEID_YEAR;
		illegalAction.caseIdNo=result.rows.item(i).CASEID_NO;
		illegalAction.party=result.rows.item(i).PARTY;
		illegalAction.caseName=result.rows.item(i).CASE_NAME;
		illegalAction.illegalLaw=result.rows.item(i).ILLEGAL_LAW;
		illegalAction.punishLaw=result.rows.item(i).PUNISH_LAW;
		illegalAction.punishDecisionCapital=result.rows.item(i).PUNISH_DECISION_CAPITAL;
		illegalAction.punishDecision=result.rows.item(i).PUNISH_DECISION;
		illegalAction.hearingRight=result.rows.item(i).HEARING_RIGHT;
		illegalAction.statementExplainRight=result.rows.item(i).STATEMENT_EXPLAIN_RIGHT;
		illegalAction.organZipCode=result.rows.item(i).ORGAN_ZIPCODE;
		illegalAction.organContactor=result.rows.item(i).ORGAN_CONTACTOR;
		illegalAction.organAddress=result.rows.item(i).ORGAN_ADDRESS;
		illegalAction.organTel=result.rows.item(i).ORGAN_TEL;
		illegalAction.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(illegalAction);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setInquestNotesDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var inquestNotes ={};
		inquestNotes.id=result.rows.item(i).CASE_INQUESTNOTES_ID;
		inquestNotes.createTime=result.rows.item(i).CREATE_TIME;
		inquestNotes.modifyTime=result.rows.item(i).MODIFY_TIME;
		inquestNotes.caseName=result.rows.item(i).CASE_NAME;
		inquestNotes.inquestYear=result.rows.item(i).INQUEST_YEAR;
		inquestNotes.inquestStartMonth=result.rows.item(i).INQUEST_START_MONTH;
		inquestNotes.inquestStartDay=result.rows.item(i).INQUEST_START_DAY;
		inquestNotes.inquestStartHour=result.rows.item(i).INQUEST_START_HOUR;
		inquestNotes.inquestStartMinute=result.rows.item(i).INQUEST_START_MINUTE;
		inquestNotes.inquestEndMonth=result.rows.item(i).INQUEST_END_MONTH;
		inquestNotes.inquestEndDay=result.rows.item(i).INQUEST_END_DAY;
		inquestNotes.inquestEndHour=result.rows.item(i).INQUEST_END_HOUR;
		inquestNotes.inquestEndMinute=result.rows.item(i).INQUEST_END_MINUTE;
		inquestNotes.inquestPlace=result.rows.item(i).INQUEST_PLACE;
		inquestNotes.weather=result.rows.item(i).WEATHER;
		inquestNotes.staff1=result.rows.item(i).STAFF_1;
		inquestNotes.unitPosition1=result.rows.item(i).UNIT_POSITION_1;
		inquestNotes.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		inquestNotes.staff2=result.rows.item(i).STAFF_2;
		inquestNotes.unitPosition2=result.rows.item(i).UNIT_POSITION_2;
		inquestNotes.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		inquestNotes.party=result.rows.item(i).PARTY;
		inquestNotes.partySex=result.rows.item(i).PARTY_SEX;
		inquestNotes.partyAge=result.rows.item(i).PARTY_AGE;
		inquestNotes.partyTel=result.rows.item(i).PARTY_TEL;
		inquestNotes.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		inquestNotes.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		inquestNotes.partyUnitPosition=result.rows.item(i).PARTY_UNIT_POSITION;
		inquestNotes.invitees=result.rows.item(i).INVITEES;
		inquestNotes.inviteesUnitPosition=result.rows.item(i).INVITEES_UNIT_POSITION;
		inquestNotes.recorder=result.rows.item(i).RECORDER;
		inquestNotes.recorderUnitPosition=result.rows.item(i).RECORDER_UNIT_POSITION;
		inquestNotes.result=result.rows.item(i).RESULT;
		inquestNotes.note=result.rows.item(i).NOTE;
	    data.push(inquestNotes);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setImportantCaseGroupDiscussionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var importantCaseGroupDiscussion ={};
		importantCaseGroupDiscussion.id=result.rows.item(i).CASE_IMPORTANTCASEGROUPDISCUSSION_ID;
		importantCaseGroupDiscussion.createTime=result.rows.item(i).CREATE_TIME;
		importantCaseGroupDiscussion.modifyTime=result.rows.item(i).MODIFY_TIME;
		importantCaseGroupDiscussion.caseName=result.rows.item(i).CASE_NAME;
		importantCaseGroupDiscussion.discussionStartYear=result.rows.item(i).DISCUSSION_START_YEAR;
		importantCaseGroupDiscussion.discussionStartMonth=result.rows.item(i).DISCUSSION_START_MONTH;
		importantCaseGroupDiscussion.discussionStartDay=result.rows.item(i).DISCUSSION_START_DAY;
		importantCaseGroupDiscussion.discussionStartHour=result.rows.item(i).DISCUSSION_START_HOUR;
		importantCaseGroupDiscussion.discussionStartMinute=result.rows.item(i).DISCUSSION_START_MINUTE;
		importantCaseGroupDiscussion.discussionEndYear=result.rows.item(i).DISCUSSION_END_YEAR;
		importantCaseGroupDiscussion.discussionEndMonth=result.rows.item(i).DISCUSSION_END_MONTH;
		importantCaseGroupDiscussion.discussionEndDay=result.rows.item(i).DISCUSSION_END_DAY;
		importantCaseGroupDiscussion.discussionEndHour=result.rows.item(i).DISCUSSION_END_HOUR;
		importantCaseGroupDiscussion.discussionEndMinute=result.rows.item(i).DISCUSSION_END_MINUTE;
		importantCaseGroupDiscussion.presidingHearer=result.rows.item(i).PRESIDING_HEARER;
		importantCaseGroupDiscussion.reporter=result.rows.item(i).REPORTER;
		importantCaseGroupDiscussion.recorder=result.rows.item(i).RECORDER;
		importantCaseGroupDiscussion.presentMembersNamePosition=result.rows.item(i).PRESENT_MEMBERS_NAME_POSITION;
		importantCaseGroupDiscussion.caseSummary=result.rows.item(i).CASE_SUMMARY;
		importantCaseGroupDiscussion.discussionRecord=result.rows.item(i).DISCUSSION_RECORD;
		importantCaseGroupDiscussion.conclussionOpinion=result.rows.item(i).CONCLUSSION_OPINION;
		importantCaseGroupDiscussion.discussionPlace=result.rows.item(i).DISCUSSION_PLACE;
	    data.push(importantCaseGroupDiscussion);
    }
	return data;
}
function setInquiryNotesDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var inquiryNotes = {};
		inquiryNotes.id = result.rows.item(i).CASE_INQUIRYNOTES_ID;
		inquiryNotes.createTime=result.rows.item(i).CREATE_TIME;
		inquiryNotes.modifyTime=result.rows.item(i).MODIFY_TIME;
		inquiryNotes.inquiryYear = result.rows.item(i).INQUIRY_YEAR;
		inquiryNotes.inquiryMonth = result.rows.item(i).INQUIRY_MONTH;
		inquiryNotes.inquiryDay = result.rows.item(i).INQUIRY_DAY;
		inquiryNotes.inquiryStartHour   = result.rows.item(i).INQUIRY_START_HOUR;
		inquiryNotes.inquiryStartMinute = result.rows.item(i).INQUIRY_START_MINUTE;
		inquiryNotes.inquiryEndHour = result.rows.item(i).INQUIRY_END_HOUR;
		inquiryNotes.inquiryEndMinute = result.rows.item(i).INQUIRY_END_MINUTE;
		inquiryNotes.inquiryIndex = result.rows.item(i).INQUIRY_INDEX;
		inquiryNotes.inquiryShare = result.rows.item(i).INQUIRY_SHARE;
		inquiryNotes.inquiryStaff = result.rows.item(i).INQUIRY_STAFF;
		inquiryNotes.recordStaff = result.rows.item(i).RECORD_STAFF;
		inquiryNotes.inquiried = result.rows.item(i).INQUIRIED;
		inquiryNotes.inquiriedRelation = result.rows.item(i).INQUIRIED_RELATION;
		inquiryNotes.inquiriedSex = result.rows.item(i).INQUIRIED_SEX;
		inquiryNotes.inquiriedAge = result.rows.item(i).INQUIRIED_AGE;
		inquiryNotes.inquiriedTel = result.rows.item(i).INQUIRIED_TEL;
		inquiryNotes.inquiriedIdNo = result.rows.item(i).INQUIRIED_ID_NO;
		inquiryNotes.inquiriedUnitPosition = result.rows.item(i).INQUIRIED_UNIT_POSITION;
		inquiryNotes.inquiriedAddress = result.rows.item(i).INQUIRIED_ADDRESS;
		inquiryNotes.organName = result.rows.item(i).ORGAN_NAME;
		inquiryNotes.staff1 = result.rows.item(i).STAFF_1;
		inquiryNotes.certificateId1 = result.rows.item(i).CERTIFICATE_ID_1;
		inquiryNotes.staff2 = result.rows.item(i).STAFF_2;
		inquiryNotes.certificateId2 = result.rows.item(i).CERTIFICATE_ID_2;
		inquiryNotes.inquiryAddress = result.rows.item(i).INQUIRY_ADDRESS;
		inquiryNotes.question = result.rows.item(i).QUESTION;
		inquiryNotes.answer = result.rows.item(i).ANSWER;
		inquiryNotes.inquiryTime = result.rows.item(i).INQUIRY_TIME;
		inquiryNotes.inquiriedTime = result.rows.item(i).INQUIRIED_TIME;
	    data.push(inquiryNotes);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setNondelayPayfineApplyOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var nondelayPayfineApply ={};
		nondelayPayfineApply.id=result.rows.item(i).CASE_NONDELAYPAYFINEAPPLY_ID;
		nondelayPayfineApply.createTime=result.rows.item(i).CREATE_TIME;
		nondelayPayfineApply.modifyTime=result.rows.item(i).MODIFY_TIME;
		nondelayPayfineApply.party=result.rows.item(i).PARTY;
		nondelayPayfineApply.deliveryYear=result.rows.item(i).DELIVERY_YEAR;
		nondelayPayfineApply.deliveryMonth=result.rows.item(i).DELIVERY_MONTH;
		nondelayPayfineApply.deliveryDay=result.rows.item(i).DELIVERY_DAY;
		nondelayPayfineApply.caseNumber=result.rows.item(i).FILENO;
		nondelayPayfineApply.punishAmount=result.rows.item(i).PUNISH_AMOUNT;
		nondelayPayfineApply.applyYear=result.rows.item(i).APPLY_YEAR;
		nondelayPayfineApply.applyMonth=result.rows.item(i).APPLY_MONTH;
		nondelayPayfineApply.applyDay=result.rows.item(i).APPLY_DAY;
		nondelayPayfineApply.reason=result.rows.item(i).REASON;
		nondelayPayfineApply.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(nondelayPayfineApply);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setNonpunishmentDecisionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var nonpunishmentDecision ={};
		nonpunishmentDecision.id=result.rows.item(i).CASE_NONPUNISHMENTDECISION_ID;
		nonpunishmentDecision.createTime=result.rows.item(i).CREATE_TIME;
		nonpunishmentDecision.modifyTime=result.rows.item(i).MODIFY_TIME;
		nonpunishmentDecision.caseIdWord=result.rows.item(i).CASEID_WORD;
		nonpunishmentDecision.caseIdYear=result.rows.item(i).CASEID_YEAR;
		nonpunishmentDecision.caseIdNo=result.rows.item(i).CASEID_NO;
		nonpunishmentDecision.party=result.rows.item(i).PARTY;
		nonpunishmentDecision.lawName=result.rows.item(i).LAW_NAME;
		nonpunishmentDecision.article=result.rows.item(i).ARTICLE;
		nonpunishmentDecision.clause=result.rows.item(i).CLAUSE;
		nonpunishmentDecision.item=result.rows.item(i).ITEM;
		nonpunishmentDecision.government=result.rows.item(i).GOVERNMENT;
		nonpunishmentDecision.reconsiderationOrgan=result.rows.item(i).RECONSIDERATION_ORGAN;
		nonpunishmentDecision.illegalFactsEvidence=result.rows.item(i).ILLEGAL_FACTS_EVIDENCE;
		nonpunishmentDecision.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(nonpunishmentDecision);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setOrderCorrectOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var orderCorrect ={};
		orderCorrect.id=result.rows.item(i).CASE_ORDERCORRECT_ID;
		orderCorrect.createTime=result.rows.item(i).CREATE_TIME;
		orderCorrect.modifyTime=result.rows.item(i).MODIFY_TIME;
		orderCorrect.caseIdWord=result.rows.item(i).CASEID_WORD;
		orderCorrect.caseIdYear=result.rows.item(i).CASEID_YEAR;
		orderCorrect.caseIdNo=result.rows.item(i).CASEID_NO;
		orderCorrect.party=result.rows.item(i).PARTY;
		orderCorrect.fact1=result.rows.item(i).FACT1;
		orderCorrect.fact2=result.rows.item(i).FACT2;
		orderCorrect.fact3=result.rows.item(i).FACT3;
		orderCorrect.fact4=result.rows.item(i).FACT4;
		orderCorrect.immediateCorrection=result.rows.item(i).IMMEDIATE_CORRECTION;
		orderCorrect.deadlineCorrection=result.rows.item(i).DEADLINE_CORRECTION;
		orderCorrect.law=result.rows.item(i).LAW;
		orderCorrect.correctionYear=result.rows.item(i).CORRECTION_YEAR;
		orderCorrect.correctionMonth=result.rows.item(i).CORRECTION_MONTH;
		orderCorrect.correctionDay=result.rows.item(i).CORRECTION_DAY;
		orderCorrect.content1=result.rows.item(i).CONTENT1;
		orderCorrect.content2=result.rows.item(i).CONTENT2;
		orderCorrect.content3=result.rows.item(i).CONTENT3;
		orderCorrect.content4=result.rows.item(i).CONTENT4;
		orderCorrect.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		orderCorrect.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		orderCorrect.signatureDate=result.rows.item(i).SIGNATURE_DATE;
	    data.push(orderCorrect);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setPunishementDecisionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var punishementDecision ={};
		punishementDecision.id=result.rows.item(i).CASE_PUNISHMENTDECISION_ID;
		punishementDecision.createTime=result.rows.item(i).CREATE_TIME;
		punishementDecision.modifyTime=result.rows.item(i).MODIFY_TIME;
		punishementDecision.caseIdWord=result.rows.item(i).CASEID_WORD;
		punishementDecision.caseIdYear=result.rows.item(i).CASEID_YEAR;
		punishementDecision.caseIdNo=result.rows.item(i).CASEID_NO;
		punishementDecision.party=result.rows.item(i).PARTY;
		punishementDecision.partyType=result.rows.item(i).PARTY_TYPE;
		punishementDecision.partySex=result.rows.item(i).PARTY_SEX;
		punishementDecision.partyTel=result.rows.item(i).PARTY_TEL;
		punishementDecision.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		punishementDecision.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		punishementDecision.partyJob=result.rows.item(i).PARTY_JOB;
		punishementDecision.partyManager=result.rows.item(i).PARTY_MANAGER;
		punishementDecision.illegalFactsEvidence=result.rows.item(i).ILLEGAL_FACTS_EVIDENCE;
		punishementDecision.illegalLaw=result.rows.item(i).ILLEGAL_LAW;
		punishementDecision.punishLaw=result.rows.item(i).PUNISH_LAW;
		punishementDecision.punishDecisionCapital=result.rows.item(i).PUNISH_DECISION_CAPITAL;
		punishementDecision.punishDecision=result.rows.item(i).PUNISH_DECISION;
		punishementDecision.bank=result.rows.item(i).BANK;
		punishementDecision.account=result.rows.item(i).ACCOUNT;
		punishementDecision.government=result.rows.item(i).GOVERNMENT;
		punishementDecision.reconsiderationOrgan=result.rows.item(i).RECONSIDERATION_ORGAN;
		punishementDecision.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(punishementDecision);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setPunishmentFinalReportOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var punishmentFinalReport ={};
		punishmentFinalReport.id=result.rows.item(i).CASE_PUNISHMENTFINALREPORT_ID;
		punishmentFinalReport.createTime=result.rows.item(i).CREATE_TIME;
		punishmentFinalReport.modifyTime=result.rows.item(i).MODIFY_TIME;
		punishmentFinalReport.caseName=result.rows.item(i).CASE_NAME;
		punishmentFinalReport.party=result.rows.item(i).PARTY;
		punishmentFinalReport.partyType=result.rows.item(i).PARTY_TYPE;
		punishmentFinalReport.partySex=result.rows.item(i).PARTY_SEX;
		punishmentFinalReport.partyAge=result.rows.item(i).PARTY_AGE;
		punishmentFinalReport.partyTel=result.rows.item(i).PARTY_TEL;
		punishmentFinalReport.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		punishmentFinalReport.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		punishmentFinalReport.partyZipCode=result.rows.item(i).PARTY_ZIPCODE;
		punishmentFinalReport.partyUnit=result.rows.item(i).PARTY_UNIT;
		punishmentFinalReport.partyManager=result.rows.item(i).PARTY_MANAGER;
		punishmentFinalReport.partyPosition=result.rows.item(i).PARTY_POSITION;
		punishmentFinalReport.processResult=result.rows.item(i).PROCESS_RESULT;
		punishmentFinalReport.execution=result.rows.item(i).EXECUTION;
		punishmentFinalReport.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		punishmentFinalReport.auditOpinion=result.rows.item(i).AUDIT_OPINION;
		punishmentFinalReport.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
		punishmentFinalReport.lawOrganOpinion=result.rows.item(i).LAW_ORGAN_OPINION;
		punishmentFinalReport.signatureDate3=result.rows.item(i).SIGNATURE_DATE_3;
	    data.push(punishmentFinalReport);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setSampleEvidenceOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var sampleEvidence ={};
		sampleEvidence.id=result.rows.item(i).CASE_SAMPLEEVIDENCE_ID;
		sampleEvidence.createTime=result.rows.item(i).CREATE_TIME;
		sampleEvidence.modifyTime=result.rows.item(i).MODIFY_TIME;
		sampleEvidence.sampled=result.rows.item(i).SAMPLED;
		sampleEvidence.sampledManager=result.rows.item(i).SAMPLED_MANAGER;
		sampleEvidence.sampledLeader=result.rows.item(i).SAMPLED_LEADER;
		sampleEvidence.sampledTel=result.rows.item(i).SAMPLED_TEL;
		sampleEvidence.sampleYear=result.rows.item(i).SAMPLE_YEAR;
		sampleEvidence.sampleStartMonth=result.rows.item(i).SAMPLE_START_MONTH;
		sampleEvidence.sampleStartDay=result.rows.item(i).SAMPLE_START_DAY;
		sampleEvidence.sampleStartHour=result.rows.item(i).SAMPLE_START_HOUR;
		sampleEvidence.sampleStartMinute=result.rows.item(i).SAMPLE_START_MINUTE;
		sampleEvidence.sampleEndMonth=result.rows.item(i).SAMPLE_END_MONTH;
		sampleEvidence.sampleEndDay=result.rows.item(i).SAMPLE_END_DAY;
		sampleEvidence.sampleEndHour=result.rows.item(i).SAMPLE_END_HOUR;
		sampleEvidence.sampleEndMinute=result.rows.item(i).SAMPLE_END_MINUTE;
		sampleEvidence.sampledAddress=result.rows.item(i).SAMPLED_ADDRESS;
		sampleEvidence.samplePlace=result.rows.item(i).SAMPLE_PLACE;
		sampleEvidence.sampleOrgan=result.rows.item(i).SAMPLE_ORGAN;
		sampleEvidence.sampleOrganTel=result.rows.item(i).SAMPLE_ORGAN_TEL;
		sampleEvidence.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		sampleEvidence.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		sampleEvidence.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(sampleEvidence);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setCaseLinkDocumentOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var caseLinkDocument ={};
		caseLinkDocument.id=result.rows.item(i).LINK_DOCUMENT_ID;
		caseLinkDocument.createTime=result.rows.item(i).CREATE_TIME;
		caseLinkDocument.modifyTime=result.rows.item(i).MODIFY_TIME;
		caseLinkDocument.docNameId=result.rows.item(i).DOCNAMEID;
		caseLinkDocument.linkNameId=result.rows.item(i).LINKNAMEID;
		caseLinkDocument.docName=result.rows.item(i).DOCNAME;
		caseLinkDocument.linkName=result.rows.item(i).LINKNAME;
		caseLinkDocument.docPath=result.rows.item(i).DOCPATH;
		caseLinkDocument.sort=result.rows.item(i).SORT;
		caseLinkDocument.required=result.rows.item(i).REQUIRED;
		caseLinkDocument.oId=result.rows.item(i).OID;
	    data.push(caseLinkDocument);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setSceneNotesDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var sceneNotes ={};
		sceneNotes.id=result.rows.item(i).CASE_SCENENOTES_ID;
		sceneNotes.createTime=result.rows.item(i).CREATE_TIME;
		sceneNotes.modifyTime=result.rows.item(i).MODIFY_TIME;
		sceneNotes.sceneYear=result.rows.item(i).SCENE_YEAR;
		sceneNotes.sceneMonth=result.rows.item(i).SCENE_MONTH;
		sceneNotes.sceneDay=result.rows.item(i).SCENE_DAY;
		sceneNotes.sceneStartHour=result.rows.item(i).SCENE_START_HOUR;
		sceneNotes.sceneStartMinute=result.rows.item(i).SCENE_START_MINUTE;
		sceneNotes.sceneEndtHour=result.rows.item(i).SCENE_END_HOUR;
		sceneNotes.sceneEndtMinute=result.rows.item(i).SCENE_END_MINUTE;
		sceneNotes.fillingPlace=result.rows.item(i).FILLING_PLACE;
		sceneNotes.staff1=result.rows.item(i).STAFF_1;
		sceneNotes.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		sceneNotes.staff2=result.rows.item(i).STAFF_2;
		sceneNotes.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		sceneNotes.recorder=result.rows.item(i).RECORDER;
		sceneNotes.party=result.rows.item(i).NAME;
		sceneNotes.partySex=result.rows.item(i).SEX;
		sceneNotes.partyIdNo=result.rows.item(i).ID_NO;
		sceneNotes.relation=result.rows.item(i).RELATION;
		sceneNotes.partyUnitPosition=result.rows.item(i).UNIT_POSITION;
		sceneNotes.partyTel=result.rows.item(i).TEL;
		sceneNotes.partyAddress=result.rows.item(i).ADDRESS;
		sceneNotes.vehicleShipId=result.rows.item(i).VEHICLE_ID;
		sceneNotes.vehicleShipType=result.rows.item(i).VEHICLE_TYPE;
		sceneNotes.illegalFacts=result.rows.item(i).ILLEGAL_FACTS;
		sceneNotes.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		sceneNotes.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
		sceneNotes.note=result.rows.item(i).NOTE;
	    data.push(sceneNotes);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setSpotPunishmentDecisionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var spotPunishmentDecision ={};
		spotPunishmentDecision.id=result.rows.item(i).CASE_SPOTPUNISHMENTDECISION_ID;
		spotPunishmentDecision.createTime=result.rows.item(i).CREATE_TIME;
		spotPunishmentDecision.modifyTime=result.rows.item(i).MODIFY_TIME;
		spotPunishmentDecision.caseIdWord=result.rows.item(i).CASEID_YEAR;
		spotPunishmentDecision.caseIdYear=result.rows.item(i).REPORT_TYPE;
		spotPunishmentDecision.caseIdNo=result.rows.item(i).CASEID_NO;
		spotPunishmentDecision.party=result.rows.item(i).PARTY;
		spotPunishmentDecision.partyType=result.rows.item(i).PARTY_TYPE;
		spotPunishmentDecision.partySex=result.rows.item(i).PARTY_SEX;
		spotPunishmentDecision.partyTel=result.rows.item(i).PARTY_TEL;
		spotPunishmentDecision.partyIdNo=result.rows.item(i).PARTY_ID_NO;
		spotPunishmentDecision.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		spotPunishmentDecision.partyJob=result.rows.item(i).PARTY_JOB;
		spotPunishmentDecision.partyManager=result.rows.item(i).PARTY_MANAGER;
		spotPunishmentDecision.illegalFactsEvidence=result.rows.item(i).ILLEGAL_FACTS_EVIDENCE;
		spotPunishmentDecision.illegalLaw=result.rows.item(i).ILLEGAL_LAW;
		spotPunishmentDecision.punishLaw=result.rows.item(i).PUNISH_LAW;
		spotPunishmentDecision.punishDecisionCapital=result.rows.item(i).PUNISH_DECISION_CAPITAL;
		spotPunishmentDecision.punishDecision=result.rows.item(i).PUNISH_DECISION;
		spotPunishmentDecision.performanceMethod=result.rows.item(i).PERFORMANCE_METHOD;
		spotPunishmentDecision.bank=result.rows.item(i).BANK;
		spotPunishmentDecision.account=result.rows.item(i).ACCOUNT;
		spotPunishmentDecision.government=result.rows.item(i).GOVERNMENT;
		spotPunishmentDecision.reconsiderationOrgan=result.rows.item(i).RECONSIDERATION_ORGAN;
		spotPunishmentDecision.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		spotPunishmentDecision.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		spotPunishmentDecision.signatureDate=result.rows.item(i).SIGNATURE_DATE;
		spotPunishmentDecision.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(spotPunishmentDecision);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setStatementExplainOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var statementExplain ={};
		statementExplain.id=result.rows.item(i).CASE_STATEMENTEXPLAIN_ID;
		statementExplain.createTime=result.rows.item(i).CREATE_TIME;
		statementExplain.modifyTime=result.rows.item(i).MODIFY_TIME;
		statementExplain.statementExplainYear=result.rows.item(i).STATEMENT_EXPLAIN_YEAR;
		statementExplain.statementExplainMonth=result.rows.item(i).STATEMENT_EXPLAIN_MONTH;
		statementExplain.statementExplainDay=result.rows.item(i).STATEMENT_EXPLAIN_DAY;
		statementExplain.statementExplainStartHour=result.rows.item(i).STATEMENT_EXPLAIN_START_HOUR;
		statementExplain.statementExplainStartMinute=result.rows.item(i).STATEMENT_EXPLAIN_START_MINUTE;
		statementExplain.statementExplainEndHour=result.rows.item(i).STATEMENT_EXPLAIN_END_HOUR;
		statementExplain.statementExplainEndMinute=result.rows.item(i).STATEMENT_EXPLAIN_END_MINUTE;
		statementExplain.place=result.rows.item(i).PLACE;
		statementExplain.party=result.rows.item(i).PARTY;
		statementExplain.partySex=result.rows.item(i).PARTY_SEX;
		statementExplain.partyUnitPosition=result.rows.item(i).PARTY_UNIT_POSITION;
		statementExplain.partyTel=result.rows.item(i).PARTY_TEL;
		statementExplain.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		statementExplain.partyZipCode=result.rows.item(i).PARTY_ZIPCODE;
		statementExplain.staff1=result.rows.item(i).STAFF_1;
		statementExplain.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		statementExplain.staff2=result.rows.item(i).STAFF_2;
		statementExplain.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		statementExplain.recorder=result.rows.item(i).RECORDER;
		statementExplain.content=result.rows.item(i).CONTENT;
		statementExplain.signatureDate=result.rows.item(i).SIGNATURE_DATE;
	    data.push(statementExplain);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setDocumentReceiptOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var documentReceipt ={};
		documentReceipt.id=result.rows.item(i).CASE_DOCUMENTRECEIPT_ID;
		documentReceipt.createTime=result.rows.item(i).CREATE_TIME;
		documentReceipt.modifyTime=result.rows.item(i).MODIFY_TIME;
		documentReceipt.caseName=result.rows.item(i).CASE_NAME;
		documentReceipt.deliveryUnit=result.rows.item(i).DELIVERY_UNIT;
		documentReceipt.party=result.rows.item(i).PARTY;
		documentReceipt.receiver=result.rows.item(i).RECEIVER;
		documentReceipt.makeDate=result.rows.item(i).MAKE_DATE;
		documentReceipt.note=result.rows.item(i).NOTE;
	    data.push(documentReceipt);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setReportRecordOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var reportRecord ={};
		reportRecord.id=result.rows.item(i).CASE_REPORTRECORD_ID;
		reportRecord.createTime=result.rows.item(i).CREATE_TIME;
		reportRecord.modifyTime=result.rows.item(i).MODIFY_TIME;
		reportRecord.reportTime=result.rows.item(i).REPORT_TIME;
		reportRecord.reportType=result.rows.item(i).REPORT_TYPE;
		reportRecord.reporter=result.rows.item(i).REPORTER;
		reportRecord.sex=result.rows.item(i).SEX;
		reportRecord.age=result.rows.item(i).AGE;
		reportRecord.addressUnit=result.rows.item(i).ADDRESS_UNIT;
		reportRecord.tel=result.rows.item(i).TEL;
		reportRecord.idNo=result.rows.item(i).ID_NO;
		reportRecord.reportContent=result.rows.item(i).REPORT_CONTENT;
		reportRecord.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		reportRecord.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
	    data.push(reportRecord);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setSampleEvidenceDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var sampleEvidenceDetail = {};
		sampleEvidenceDetail.id = result.rows.item(i).CASE_SAMPLEEVIDENCE_DETAIL_ID;
		sampleEvidenceDetail.createTime=result.rows.item(i).CREATE_TIME;
		sampleEvidenceDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		sampleEvidenceDetail.itemNo = result.rows.item(i).ITEM_NO;
		sampleEvidenceDetail.itemName = result.rows.item(i).ITEM_NAME;
		sampleEvidenceDetail.specBathcNo = result.rows.item(i).SPEC_BATCH_NO;
		sampleEvidenceDetail.amount = result.rows.item(i).AMOUNT;
		sampleEvidenceDetail.sampledPlace  = result.rows.item(i).SAMPLED_PLACE;
	    data.push(sampleEvidenceDetail);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setCoverDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var cover ={};
		cover.id=result.rows.item(i).CASE_COVER_ID;
		cover.createTime=result.rows.item(i).CREATE_TIME;
		cover.modifyTime=result.rows.item(i).MODIFY_TIME;
		cover.caseName=result.rows.item(i).CASE_NAME;
		cover.fileNo=result.rows.item(i).FILENO;
		cover.makeDate=result.rows.item(i).MAKE_DATE;
		cover.operator=result.rows.item(i).OPERATOR;
		cover.party=result.rows.item(i).PARTY;
		cover.partyUnitAddress=result.rows.item(i).PARTY_UNIT_ADDRESS;
	    data.push(cover);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFileListOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var fileList ={};
		fileList.id=result.rows.item(i).CASE_FILELIST_ID;
		fileList.createTime=result.rows.item(i).CREATE_TIME;
		fileList.modifyTime=result.rows.item(i).MODIFY_TIME;
	    data.push(fileList);
    }
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFileListDetailDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var fileListDetail = {};
		fileListDetail.id = result.rows.item(i).CASE_FILELIST_DETAIL_ID;
		fileListDetail.createTime=result.rows.item(i).CREATE_TIME;
		fileListDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		fileListDetail.fileOrder = result.rows.item(i).FILE_ORDER;
		fileListDetail.fileName = result.rows.item(i).FILE_NAME;
		fileListDetail.fileNo = result.rows.item(i).FILENO;
		fileListDetail.filePage = result.rows.item(i).FILE_PAGE;
		fileListDetail.makeDate  = result.rows.item(i).MAKE_DATE;
	    data.push(fileListDetail);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFileClanListOffLine(result){
	var len = result.rows.length;
	var data = new Array();
	for (var i = 0; i < len; i++){
		var fileClanList ={};
		fileClanList.id=result.rows.item(i).CASE_FILECLANLIST_ID;
		fileClanList.createTime=result.rows.item(i).CREATE_TIME;
		fileClanList.modifyTime=result.rows.item(i).MODIFY_TIME;
		data.push(fileClanList);
	}
	return data;
}
/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFileClanListDetailDataOffLine(result){
	var len = result.rows.length;
	var data = new Array();
	for (var i = 0; i < len; i++){
		var fileClanListDetail = {};
		fileClanListDetail.id = result.rows.item(i).CASE_FILECLANLIST_DETAIL_ID;
		fileClanListDetail.createTime=result.rows.item(i).CREATE_TIME;
		fileClanListDetail.modifyTime=result.rows.item(i).MODIFY_TIME;
		fileClanListDetail.fileClanOrder = result.rows.item(i).FILECLANORDER;
		fileClanListDetail.fileClanName = result.rows.item(i).FILECLANNAME;
		fileClanListDetail.fileClanNote = result.rows.item(i).FILECLANNOTE;
		fileClanListDetail.fileClanPage = result.rows.item(i).FILECLANPAGE;
		data.push(fileClanListDetail);
	}
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setFileNoteDataOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var fileNote ={};
		fileNote.id=result.rows.item(i).CASE_FILENOTE_ID;
		fileNote.createTime=result.rows.item(i).CREATE_TIME;
		fileNote.modifyTime=result.rows.item(i).MODIFY_TIME;
		fileNote.fileDescription=result.rows.item(i).FILE_DESCRIPTION;
		fileNote.fillingPerson=result.rows.item(i).FILLING_PERSON;
		fileNote.checkPerson=result.rows.item(i).CHECK_PERSON;
		fileNote.fillingTime=result.rows.item(i).FILLING_TIME;
	    data.push(fileNote);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setAdministrationEnforceLawFileOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var administrationEnforceLawFile ={};
		administrationEnforceLawFile.id=result.rows.item(i).CASE_ADMINENFORCEFILE_ID;
		administrationEnforceLawFile.createTime=result.rows.item(i).CREATE_TIME;
		administrationEnforceLawFile.modifyTime=result.rows.item(i).MODIFY_TIME;
		administrationEnforceLawFile.organName=result.rows.item(i).CASE_ORGANNAME;
		administrationEnforceLawFile.serialNumber=result.rows.item(i).CASE_SERIALNUMBER;
		administrationEnforceLawFile.caseIdNo=result.rows.item(i).CASEID_NO;
		administrationEnforceLawFile.caseIdWord=result.rows.item(i).CASEID_WORD;
		administrationEnforceLawFile.caseIdYear=result.rows.item(i).CASEID_YEAR;
	    data.push(administrationEnforceLawFile);
    }
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setRoadCaseFileOffLine(result){
	var len = result.rows.length;
	var data = new Array();
	for (var i = 0; i < len; i++){
		var roadCaseFile ={};
		roadCaseFile.id=result.rows.item(i).CASE_ROADCASEFILE_ID;
		roadCaseFile.createTime=result.rows.item(i).CREATE_TIME;
		roadCaseFile.modifyTime=result.rows.item(i).MODIFY_TIME;
		roadCaseFile.caseName=result.rows.item(i).CASENAME;
		roadCaseFile.party=result.rows.item(i).PARTY;
		roadCaseFile.organAndStaff=result.rows.item(i).ORGANANDSTAFF;
		roadCaseFile.punishAmount=result.rows.item(i).PUNISH_AMOUNT;
		roadCaseFile.fillingDate=result.rows.item(i).FILLING_DATE;
		roadCaseFile.closeDate=result.rows.item(i).CLOSE_DATE;
		roadCaseFile.pigeonholeDate=result.rows.item(i).PIGEONHOLE_DATE;
		roadCaseFile.safeTerm=result.rows.item(i).SAFETERM;
		data.push(roadCaseFile);
	}
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setVehicleToolsDetainVoucherOffLine(result){
	var len = result.rows.length;
	var data = new Array();
	for (var i = 0; i < len; i++){
		var vehicleToolsDetainVoucher ={};
		vehicleToolsDetainVoucher.id=result.rows.item(i).CASE_VEHICLETOOLVOUCHER_ID;
		vehicleToolsDetainVoucher.createTime=result.rows.item(i).CREATE_TIME;
		vehicleToolsDetainVoucher.modifyTime=result.rows.item(i).MODIFY_TIME;
		vehicleToolsDetainVoucher.note=result.rows.item(i).NOTE;
		vehicleToolsDetainVoucher.caseIdNo=result.rows.item(i).CASEID_NO;
		vehicleToolsDetainVoucher.caseIdWord=result.rows.item(i).CASEID_WORD;
		vehicleToolsDetainVoucher.caseIdYear=result.rows.item(i).CASEID_YEAR;
		vehicleToolsDetainVoucher.party=result.rows.item(i).PARTY;
		vehicleToolsDetainVoucher.partyType=result.rows.item(i).PARTY_TYPE;
		vehicleToolsDetainVoucher.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		vehicleToolsDetainVoucher.vehicleShipId=result.rows.item(i).VEHICLESHIPID;
		vehicleToolsDetainVoucher.vehicleBrandModel=result.rows.item(i).VEHICLEBRANDMODEL;
		vehicleToolsDetainVoucher.toolBrandModel=result.rows.item(i).TOOLBRANDMODEL;
		vehicleToolsDetainVoucher.toolName=result.rows.item(i).TOOLNAME;
		vehicleToolsDetainVoucher.driverName=result.rows.item(i).DRIVER_NAME;
		vehicleToolsDetainVoucher.driverNo=result.rows.item(i).DRIVER_NO;
		vehicleToolsDetainVoucher.driverNexus=result.rows.item(i).DRIVER_NEXUS;
		vehicleToolsDetainVoucher.driverAddress=result.rows.item(i).DRIVER_ADDRESS;
		vehicleToolsDetainVoucher.detainYear=result.rows.item(i).DETAIN_YEAR;
		vehicleToolsDetainVoucher.detainMonth=result.rows.item(i).DETAIN_MONTH;
		vehicleToolsDetainVoucher.detainDay=result.rows.item(i).DETAIN_DAY;
		vehicleToolsDetainVoucher.detainHour=result.rows.item(i).DETAIN_HOUR;
		vehicleToolsDetainVoucher.detainMinute=result.rows.item(i).DETAIN_MINUTE;
		vehicleToolsDetainVoucher.detainAddress=result.rows.item(i).DETAIN_ADDRESS;
		vehicleToolsDetainVoucher.detainDate=result.rows.item(i).DETAIN_DATE;
		vehicleToolsDetainVoucher.handleDay=result.rows.item(i).HANDLE_DAY;
		vehicleToolsDetainVoucher.handleOrgan=result.rows.item(i).HANDLE_ORGAN;
		vehicleToolsDetainVoucher.organTel=result.rows.item(i).ORGANTEL;
		vehicleToolsDetainVoucher.reconsiderationOrgan=result.rows.item(i).RECONSIDERATIOINORGAN;
		vehicleToolsDetainVoucher.vehicleToolProfile=result.rows.item(i).VEHICLETOOLPROFILE;
		vehicleToolsDetainVoucher.suspenTime=result.rows.item(i).SUSPENTIME;
		vehicleToolsDetainVoucher.certificateId1=result.rows.item(i).CERTIFICATEID1;
		vehicleToolsDetainVoucher.certificateId2=result.rows.item(i).CERTIFICATEID2;
		vehicleToolsDetainVoucher.makeDate=result.rows.item(i).MAKEDATE;
		data.push(vehicleToolsDetainVoucher);
	}
	return data;
}

/**
 * 组装数据list
 * @param result
 * @returns {Array}
 */
function setVehicleDetainVoucherOffLine(result){
	var len = result.rows.length;
	var data = new Array();
	for (var i = 0; i < len; i++){
		var vehicleDetainVoucher ={};
		vehicleDetainVoucher.id=result.rows.item(i).CASE_VEHICLEVOUCHER_ID;
		vehicleDetainVoucher.createTime=result.rows.item(i).CREATE_TIME;
		vehicleDetainVoucher.modifyTime=result.rows.item(i).MODIFY_TIME;
		vehicleDetainVoucher.note=result.rows.item(i).NOTE;
		vehicleDetainVoucher.caseIdNo=result.rows.item(i).CASEID_NO;
		vehicleDetainVoucher.caseIdWord=result.rows.item(i).CASEID_WORD;
		vehicleDetainVoucher.caseIdYear=result.rows.item(i).CASEID_YEAR;
		vehicleDetainVoucher.party=result.rows.item(i).PARTY;
		vehicleDetainVoucher.partyType=result.rows.item(i).PARTY_TYPE;
		vehicleDetainVoucher.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		vehicleDetainVoucher.vehicleShipId=result.rows.item(i).VEHICLESHIPID;
		vehicleDetainVoucher.vehicleBrandModel=result.rows.item(i).VEHICLEBRANDMODEL;
		vehicleDetainVoucher.driverName=result.rows.item(i).DRIVER_NAME;
		vehicleDetainVoucher.driverNo=result.rows.item(i).DRIVER_NO;
		vehicleDetainVoucher.driverNexus=result.rows.item(i).DRIVER_NEXUS;
		vehicleDetainVoucher.driverAddress=result.rows.item(i).DRIVER_ADDRESS;
		vehicleDetainVoucher.detainYear=result.rows.item(i).DETAIN_YEAR;
		vehicleDetainVoucher.detainMonth=result.rows.item(i).DETAIN_MONTH;
		vehicleDetainVoucher.detainDay=result.rows.item(i).DETAIN_DAY;
		vehicleDetainVoucher.detainHour=result.rows.item(i).DETAIN_HOUR;
		vehicleDetainVoucher.detainMinute=result.rows.item(i).DETAIN_MINUTE;
		vehicleDetainVoucher.detainAddress=result.rows.item(i).DETAIN_ADDRESS;
		vehicleDetainVoucher.detainDate=result.rows.item(i).DETAIN_DATE;
		vehicleDetainVoucher.handleOrgan=result.rows.item(i).HANDLE_ORGAN;
		vehicleDetainVoucher.organTel=result.rows.item(i).ORGANTEL;
		vehicleDetainVoucher.reconsiderationOrgan=result.rows.item(i).RECONSIDERATIOINORGAN;
		vehicleDetainVoucher.vehicleToolProfile=result.rows.item(i).VEHICLETOOLPROFILE;
		vehicleDetainVoucher.suspenTime=result.rows.item(i).SUSPENTIME;
		vehicleDetainVoucher.certificateId1=result.rows.item(i).CERTIFICATEID1;
		vehicleDetainVoucher.certificateId2=result.rows.item(i).CERTIFICATEID2;
		vehicleDetainVoucher.makeDate=result.rows.item(i).MAKEDATE;
		data.push(vehicleDetainVoucher);
	}
	return data;
}

function setInquiryNotesCountOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var inquiryNotes ={};
		inquiryNotes.inquiryIndex=result.rows.item(i).INQUIRY_INDEX;
	    data.push(inquiryNotes);
    }
	return data;
}
/**
 * 通过案件处理意见书ID获取 案件处理意见书明细
 * @param caseBasicInfoId
 * @param callback
 */
function findAllCaseProcessIdeaDetailByIdOnLine(caseProcessIdea,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryCaseProcessIdeaDetail",
		data : {
			id : caseProcessIdea.id
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.caseProcessIdeaDetail,"#caseProcessIdeaDetailForm",caseProcessIdea);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取案件处理意见书明细列表失败");
        }
	});
}
/**
 * 获取案件处理意见书明细列表
 */
function findAllCaseProcessIdeaDetailByIdOffLine(caseProcessIdea,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_CASEPROCESSIDEA_DETAIL WHERE CASE_CASEPROCESSIDEA_ID = '+parseInt(caseProcessIdea.id), [], function (tx, result){
			var data=setCaseProcessIdeaDetailDataOffLine(result);
			   if(typeof(callback) == 'function'){
	   	    	 callback(data,"#caseProcessIdeaDetailForm",caseProcessIdea);
	   	        }
		    }, 
		    function(tx, error) {
		    	message("获取案件处理意见书明细列表失败:"+ error.message);
	        });  
	});
}
/**
 * 通过文书送达回证ID获取 文书送达回证明细
 * @param caseBasicInfoId
 * @param callback
 */
function findAllDocumentReceiptDetailByIdOnLine(documentReceipt,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfo/queryDocumentReceiptDetail",
		data : {
			id : documentReceipt.id
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function')
						callback(data.documentReceiptDetail,"#documentReceiptDetailForm",documentReceipt);
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		},
		error: function(request) {
            message("获取文书送达回证明细列表失败");
        }
	});
}

/**
 * 获取文书送达回证明细列表
 */
function findAllDocumentReceiptDetailByIdOffLine(documentReceipt,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_DOCUMENTRECEIPT_DETAIL WHERE CASE_DOCUMENTRECEIPT_ID = '+parseInt(documentReceipt.id), [], function (tx, result){
			var data=setDocumentReceiptDetailDataOffLine(result);
			   if(typeof(callback) == 'function'){
	   	    	 callback(data,"#documentReceiptDetailForm",documentReceipt);
	   	        }
		    }, 
		    function(tx, error) {
		    	message("获取文书送达回证明细列表失败:"+ error.message);
	        });  
	});
}

/**
 * 获取委托鉴定书明细列表
 */
function findAllEntrustIdentifyDetailByIdOffLine(entrustIdentify,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ENTRUSTIDENTIFY_DETAIL WHERE CASE_ENTRUSTIDENTIFY_ID = '+parseInt(entrustIdentify.id), [], function (tx, result){
			var data=setEntrustIdentifyDetailDataOffLine(result);
			   if(typeof(callback) == 'function'){
	   	    	 callback(data,"#entrustIdentifyDetailForm",entrustIdentify);
	   	        }
		    }, 
		    function(tx, error) {
		    	message("获取委托鉴定书明细列表失败:"+ error.message);
	        });  
	});
}

/**
 * 获取 证据登记保存清单明细列表
 */
function findAllEvidenceListDetailByIdOffLine(evidenceList,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_EVIDENCELIST_DETAIL WHERE CASE_EVIDENCELIST_ID = '+parseInt(evidenceList.id), [], function (tx, result){
			var data=setEvidenceListDetailDataOffLine(result);
			   if(typeof(callback) == 'function'){
	   	    	 callback(data,"#evidenceListDetailForm",evidenceList);
	   	        }
		    }, 
		    function(tx, error) {
		    	message("获取证据登记保存清单明细列表失败:"+ error.message);
	        });  
	});
}

/**
 * 获取抽样取证凭证明细列表
 */
function findAllSampleEvidenceDetailByIdOffLine(sampleEvidence,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SAMPLEEVIDENCE_DETAIL WHERE CASE_SAMPLEEVIDENCE_ID = '+parseInt(sampleEvidence.id), [], function (tx, result){
			var data=setSampleEvidenceDetailDataOffLine(result);
			   if(typeof(callback) == 'function'){
	   	    	 callback(data,"#sampleEvidenceDetailForm",sampleEvidence);
	   	        }
		    }, 
		    function(tx, error) {
		    	message("获取抽样取证凭证明细列表失败:"+ error.message);
	        });  
	});
}

/**
 * 通过案件ID获取 行政强制措施通知书
 * @param caseBasicInfoId
 * @param callback
 */
function findAdministrativeNoticeByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHn/queryAdministrativeNotice",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				 if(typeof(callback)=='function'){
						callback(data.administrativeNotice,"#administrativeNoticeForm");
					}
				 return data.administrativeNotice;
			 }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
		}
	});
}

/**
 * 通过案件ID 行政强制措施通知书
 * @param casebasicInfoId
 * @param callback
 */
function findAdministrativeNoticeByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_ADMINISTRATIVENOTICE  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
		    if(len > 1){
		    	message("获取行政强制措施通知书错误");
		    	return;
		    }
		    data = setAdministrativeNoticeOffLine(result);
		    if(typeof(callback) == 'function'){
    	    	callback(data[0],"#administrativeNoticeForm");
    	    }
		    return data[0];
	    }, 
	    function(tx, error) {
	    	message("行政强制措施通知书不存在");
        });  
	});
}

function setAdministrativeNoticeOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var administrativeNotice ={};
		administrativeNotice.id=result.rows.item(i).CASE_FILENOTE_ID;
		administrativeNotice.createTime=result.rows.item(i).CREATE_TIME;
		administrativeNotice.modifyTime=result.rows.item(i).MODIFY_TIME;
		administrativeNotice.caseIdNo=result.rows.item(i).CASEID_NO;
		administrativeNotice.caseIdYear=result.rows.item(i).CASEID_YEAR;
		administrativeNotice.caseIdWord=result.rows.item(i).CASEID_WORD;
		administrativeNotice.party=result.rows.item(i).PARTY;
		administrativeNotice.adminYear=result.rows.item(i).ADMIN_YEAR;
		administrativeNotice.adminMonth=result.rows.item(i).ADMIN_MONTH;
		administrativeNotice.adminDay=result.rows.item(i).ADMIN_DAY;
		administrativeNotice.vehicleShipId=result.rows.item(i).VEHICLE_SHIP_ID;
		administrativeNotice.vehicleCheckTon=result.rows.item(i).VEHICLE_CHECK_TON;
		administrativeNotice.vehicleSenceTon=result.rows.item(i).VEHICLE_SENCE_TON;
		administrativeNotice.ccertId=result.rows.item(i).CCERT_ID;
		administrativeNotice.ccertName=result.rows.item(i).CCERT_NAME;
		administrativeNotice.other1=result.rows.item(i).OTHER_1;
		administrativeNotice.other2=result.rows.item(i).OTHER_2;
		administrativeNotice.illegalLawItem=result.rows.item(i).ILLEGAL_LAW_ITEM;
		administrativeNotice.punishLawItem=result.rows.item(i).PUNISH_LAW_ITEM;
		administrativeNotice.organAddress=result.rows.item(i).ORGAN_ADDRESS;
		administrativeNotice.organZipCode=result.rows.item(i).ORGAN_ZIPCODE;
		administrativeNotice.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(administrativeNotice);
    }
	return data;
}

/**
 * 通过案件ID获取 暂扣车辆行政强制措施决定书
 * @param caseBasicInfoId
 * @param callback
 */
function findSuspensionVehicleDecisionByIdOnLine(caseBasicInfoId,callback){
	$.ajax({
		type : "post",
		url : getContextPath() + "/caseBasicInfoHn/querySuspensionVehicle",
		data : {
			id : caseBasicInfoId
		},
		dataType : "json",
		success : function(data) {
			if(data.result=='success'){
				if(typeof(callback)=='function'){
					callback(data.suspensionVehicleDecision,"#suspensionVehicleDecisionForm");
				}
				return data.suspensionVehicleDecision;
			}else{
				message(data.errorCode + ":" +data.errorMessage);
			}
		}
	});
}

/**
 * 通过案件ID 暂扣车辆行政强制措施决定书
 * @param casebasicInfoId
 * @param callback
 */
function findSuspensionVehicleDecisionByIdOffLine(casebasicInfoId,callback){
	db.transaction(function (tx) { 
		tx.executeSql('SELECT * FROM CASE_DOCU_SUSPENSIONVEHICLE  WHERE CASE_BASICINFO_ID = '+parseInt(casebasicInfoId), [], function (tx, result){
			var len = result.rows.length;
			var data = new Array();
			if(len > 1){
				message("获取暂扣车辆行政强制措施决定书错误");
				return;
			}
			data = setSuspensionVehicleDecisionOffLine(result);
			if(typeof(callback) == 'function'){
				callback(data[0],"#suspensionVehicleDecisionForm");
			}
			return data[0];
		}, 
		function(tx, error) {
			message("暂扣车辆行政强制措施决定书不存在");
		});  
	});
}

function setSuspensionVehicleDecisionOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var suspensionVehicleDecision ={};
		suspensionVehicleDecision.id=result.rows.item(i).CASE_SUSPENSIONVEHICLE_ID;
		suspensionVehicleDecision.createTime=result.rows.item(i).CREATE_TIME;
		suspensionVehicleDecision.modifyTime=result.rows.item(i).MODIFY_TIME;
		suspensionVehicleDecision.caseIdNo=result.rows.item(i).CASEID_NO;
		suspensionVehicleDecision.caseIdYear=result.rows.item(i).CASEID_YEAR;
		suspensionVehicleDecision.caseIdWord=result.rows.item(i).CASEID_WORD;
		suspensionVehicleDecision.party=result.rows.item(i).PARTY;
		suspensionVehicleDecision.partyType=result.rows.item(i).PARTY_TYPE;
		suspensionVehicleDecision.partyIdNo=result.rows.item(i).PARTYIDNO;
		suspensionVehicleDecision.partySex=result.rows.item(i).PARTYSEX;
		suspensionVehicleDecision.partyUnitPosition=result.rows.item(i).PARTYUNITPOSITION;
		suspensionVehicleDecision.partyAddress=result.rows.item(i).PARTYADDRESS;
		suspensionVehicleDecision.partyManager=result.rows.item(i).PARTYMANAGER;
		suspensionVehicleDecision.vehicleRelationship=result.rows.item(i).VEHICLERELATIONSHIP;
		suspensionVehicleDecision.partyTel=result.rows.item(i).PARTYTEL;
		suspensionVehicleDecision.suspenYear=result.rows.item(i).SUSPEN_YEAR;
		suspensionVehicleDecision.suspenMonth=result.rows.item(i).SUSPEN_MONTH;
		suspensionVehicleDecision.suspenDay=result.rows.item(i).SUSPEN_DAY;
		suspensionVehicleDecision.suspenHour=result.rows.item(i).SUSPEN_HOUR;
		suspensionVehicleDecision.vehicleShipId=result.rows.item(i).VEHICLE_SHIP_ID;
		suspensionVehicleDecision.temporarilyDate=result.rows.item(i).TEMPORARILY_DATE;
		suspensionVehicleDecision.temporarilyAddress=result.rows.item(i).TEMPORARILY_ADDRESS;
		suspensionVehicleDecision.imgNum=result.rows.item(i).IMGNUM;
		suspensionVehicleDecision.reconsiderationOrgan=result.rows.item(i).RECONSIDERATION_ORGAN;
		suspensionVehicleDecision.suspenTime=result.rows.item(i).SUSPEN_TIME;
		suspensionVehicleDecision.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		suspensionVehicleDecision.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		suspensionVehicleDecision.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(suspensionVehicleDecision);
    }
	return data;
}

function setSampleEvidenceData(sampleEvidence,formId,sampleEvidenceDetails){
	if(null==sampleEvidence)return;
	setData(sampleEvidence,formId);
    setSampleEvidenceDetailData(sampleEvidenceDetails,formId);
}
/**
 * 设置抽样取证明细表单
 * @param data
 */
function setSampleEvidenceDetailData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #sampleEvidenceId"+i).text(item.id);
			$(formId+" #itemNo"+i).text(item.itemNo);
			$(formId+" #itemName"+i).text(item.itemName);
			$(formId+" #specBathcNo"+i).text(item.specBathcNo);
			$(formId+" #amount"+i).text(item.amount);
			$(formId+" #sampledPlace"+i).text(item.sampledPlace);
	  });	
	}
}
function setSampleEvidenceInputData(sampleEvidence,formId,sampleEvidenceDetails){
	if(null==sampleEvidence)return;
	setData(sampleEvidence,formId);
	setSampleEvidenceDetailInputData(sampleEvidenceDetails,formId);
}
/**
 * 设置抽样取证明细表单
 * @param data
 */
function setSampleEvidenceDetailInputData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #sampleEvidenceId"+i).val(item.id);
			$(formId+" #itemNo"+i).numberbox('setValue',item.itemNo);
			$(formId+" #itemName"+i).textbox('setValue',item.itemName);
			$(formId+" #specBathcNo"+i).textbox('setValue',item.specBathcNo);
			$(formId+" #amount"+i).numberbox('setValue',item.amount);
			$(formId+" #sampledPlace"+i).textbox('setValue',item.sampledPlace);
		});	
	}
}

function setEntrustIdentifyData(entrustIdentify,formId,entrustIdentifyDetails){
	if(null==entrustIdentify)return;
	setData(entrustIdentify,formId);
    setEntrustIdentifyDetailData(entrustIdentifyDetails,formId);
}
/**
 * 设置委托鉴定书明细表单
 * @param data
 */
function setEntrustIdentifyDetailData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #entrustIdentifyId"+i).text(item.id);
			$(formId+" #itemName"+i).text(item.itemName);
			$(formId+" #specModel"+i).text(item.specModel);
			$(formId+" #amount"+i).text(item.amount);
			$(formId+" #note"+i).text(item.note);
	  });	
	}
}
function setEntrustIdentifyInputData(entrustIdentify,formId,entrustIdentifyDetails){
	if(null==entrustIdentify)return;
	setData(entrustIdentify,formId);
	setEntrustIdentifyDetailInputData(entrustIdentifyDetails,formId);
}
/**
 * 设置委托鉴定书明细表单
 * @param data
 */
function setEntrustIdentifyDetailInputData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #entrustIdentifyId"+i).val(item.id);
			$(formId+" #itemName"+i).textbox('setValue',item.itemName);
			$(formId+" #specModel"+i).textbox('setValue',item.specModel);
			$(formId+" #amount"+i).numberbox('setValue',item.amount);
			$(formId+" #note"+i).textbox('setValue',item.note);
		});	
	}
}

function setEvidenceListData(evidenceList,formId,evidenceListDetails){
	if(null==evidenceList)
		return;
	$.each(evidenceList,function(key,value){
	   $(formId + " span[id="+key+"]").each(function(index,item){
		$(this).text(value);
	   });
	});
	if(evidenceList.partyType=="个人"){
		$(formId+" #party1").text(evidenceList.party);
		$(formId+" #partyTel1").text(evidenceList.partyTel);
		$(formId+" #partyAddress1").text(evidenceList.partyAddress);
	}else{
		$(formId+" #party2").text(evidenceList.party);
		$(formId+" #partyTel2").text(evidenceList.partyTel);
		$(formId+" #partyAddress2").text(evidenceList.partyAddress);
	}
    setEvidenceListDetailData(evidenceListDetails,formId);
}
/**
 * 设置证据登记保存明细表单
 * @param data
 */
function setEvidenceListDetailData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #evidenceListId"+i).text(item.id);
			$(formId+" #evidenceNo"+i).text(item.evidenceNo);
			$(formId+" #evidenceName"+i).text(item.evidenceName);
			$(formId+" #spec"+i).text(item.spec);
			$(formId+" #amount"+i).text(item.amount);
			$(formId+" #savePlace"+i).text(item.savePlace);
	  });	
	}
}

/**
 * 设置证据登记保存清单及明细
 */
function setEvidenceListInputData(evidenceList,formId,evidenceListDetails){
	if(null==evidenceList){
		return;
	}
	setData(evidenceList,formId);
//	if(evidenceList.partyType=="个人"){
//		$("#evidenceListForm #party1").textbox('setValue',evidenceList.party);
//		$("#evidenceListForm #partyTel1").textbox('setValue',evidenceList.partyTel);
//		$("#evidenceListForm #partyAddress1").textbox('setValue',evidenceList.partyAddress);
//	}else{
//		$("#evidenceListForm #party2").textbox('setValue',evidenceList.party);
//		$("#evidenceListForm #partyTel2").textbox('setValue',evidenceList.partyTel);
//		$("#evidenceListForm #partyAddress2").textbox('setValue',evidenceList.partyAddress);
//	}
	setEvidenceListDetailInputData(evidenceListDetails,formId);
}
/**
 * 设置证据登记保存明细表单
 * @param data
 */
function setEvidenceListDetailInputData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #evidenceListId"+i).val(item.id);
			$(formId+" #evidenceNo"+i).numberbox('setValue',item.evidenceNo);
			$(formId+" #evidenceName"+i).textbox('setValue',item.evidenceName);
			$(formId+" #spec"+i).textbox('setValue',item.spec);
			$(formId+" #amount"+i).numberbox('setValue',item.amount);
			$(formId+" #savePlace"+i).textbox('setValue',item.savePlace);
		});	
	}
}

/**
 * 设置证据登记保存处理决定书中,登记保存物品清单数据
 * @param caseProcessIdea
 * @param formId
 * @param caseProcessIdeaDetails
 */
function setSavingItemsData(formId,data){
	var itemsStr = "";
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			if(i<data.length-1){
				itemsStr += item.evidenceName+"、";
			}else{
				itemsStr += item.evidenceName;
			}
		});	
	}
	$(formId+" #savingItems").textbox('setValue',itemsStr);
}

function setCaseProcessIdeaData(caseProcessIdea,formId,caseProcessIdeaDetails){
	if(null==caseProcessIdea)
		return;
	$.each(caseProcessIdea,function(key,value){
		   $(formId + " span[id="+key+"]").each(function(index,item){
			$(this).text(value);
		   });
		});
	if(caseProcessIdea.partyType="个人"){
		$(formId+" #party1").text(caseProcessIdea.party);
		$(formId+" #partyAddress1").text(caseProcessIdea.partyAddress);
	}else{
		$(formId+" #party2").text(caseProcessIdea.party);
		$(formId+" #partyAddress2").text(caseProcessIdea.partyAddress);
	}
    setCaseProcessIdeaDetailData(caseProcessIdeaDetails,formId);
}
/**
 * 设置案件处理意见书明细表单
 * @param data
 */
function setCaseProcessIdeaDetailData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #caseProcessIdeaId"+i).text(item.id);
			$(formId+" #evidenceNo"+i).text(item.evidenceNo);
			$(formId+" #itemName"+i).text(item.itemName);
			$(formId+" #specModel"+i).text(item.specModel);
			$(formId+" #amount"+i).text(item.amount);
	  });	
	}
}
function setCaseProcessIdeaInputData(caseProcessIdea,formId,caseProcessIdeaDetails){
	if(null==caseProcessIdea)
		return;
	setData(caseProcessIdea,formId);
	if(caseProcessIdea.partyType="个人"){
		$("#caseProcessIdeaForm #party1").textbox('setValue',caseProcessIdea.party);
		$("#caseProcessIdeaForm #partyAddress1").textbox('setValue',caseProcessIdea.partyAddress);
		
	}else{
		$("#caseProcessIdeaForm #party2").textbox('setValue',caseProcessIdea.party);
		$("#caseProcessIdeaForm #partyAddress2").textbox('setValue',caseProcessIdea.partyAddress);
	}
	setCaseProcessIdeaDetailInputData(caseProcessIdeaDetails,formId);
}
/**
 * 设置案件处理意见书明细表单
 * @param data
 */
function setCaseProcessIdeaDetailInputData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #caseProcessIdeaId"+i).val(item.id);
			$(formId+" #evidenceNo"+i).textbox('setValue',item.evidenceNo);
			$(formId+" #itemName"+i).textbox('setValue',item.itemName);
			$(formId+" #specModel"+i).textbox('setValue',item.specModel);
			$(formId+" #amount"+i).numberbox('setValue',item.amount);
		});	
	}
}

function setDocumentReceiptData(documentReceipt,formId,documentReceiptDetails){
	if(null==documentReceipt)return;
	setData(documentReceipt,formId);
	setDocumentReceiptDetailData(documentReceiptDetails,formId);
}
/**
 * 设置文书送达回证明细表单
 * @param data
 */
function setDocumentReceiptDetailData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+" #documentReceiptId"+i).text(item.id);
			$(formId+" #documentNameNo"+i).text(item.documentNameNo);
			$(formId+" #signature"+i).text(item.signature == null ? "" : item.signature);
			$(formId+" #deliveryPlace"+i).text(item.deliveryPlace == null ? "" : item.deliveryPlace);
			$(formId+" #deliveryType"+i).text(item.deliveryType == null ? "" : item.deliveryType);
			$(formId+" #processServer"+i).text(item.processServer == null ? "" : item.processServer);
	  });	
	}
}
function setDocumentReceiptInputData(documentReceipt,formId,documentReceiptDetails){
	if(null==documentReceipt){
		setDocumentReceiptDetailInputData(documentReceiptDetails,formId);
	}else{
		 setData(documentReceipt,formId);
		 setDocumentReceiptDetailInputData(documentReceiptDetails,formId);
	}
	//setDocumentReceiptDetailInputData(documentReceiptDetails,formId);
}
/**
 * 设置文书送达回证明细表单
 * @param data
 */
function setDocumentReceiptDetailInputData(data,formId){
	if(null==data || data.length<=0){
		 var ary = new Array();
		    var arry=["违法行为通知书","行政处罚决定书","当场缴纳罚款申请书","证据登记保存清单","解除行政强制措施通知书"];
		    var len=arry.length;
			for (var i = 0; i < len; i++){
				var documentReceiptDetail = {};
				documentReceiptDetail.id = "";
				documentReceiptDetail.createTime=currentTime();
				documentReceiptDetail.modifyTime=currentTime();
				documentReceiptDetail.documentNameNo =arry[i];
				documentReceiptDetail.signature = "";
				documentReceiptDetail.deliveryPlace = "";
				documentReceiptDetail.deliveryType = "";
				documentReceiptDetail.processServer   = "";
				ary.push(documentReceiptDetail);
		    }
			$.each(ary, function(i,item){
				$(formId+ " #documentReceiptId"+i).val(item.id);
				$(formId+" #documentNameNo"+i).textbox('setValue',item.documentNameNo);
				$(formId+" #signature"+i).textbox('setValue',item.signature);
				$(formId+" #deliveryPlace"+i).textbox('setValue',item.deliveryPlace);
				$(formId+" #deliveryType"+i).textbox('setValue',item.deliveryType);
				$(formId+" #processServer"+i).textbox('setValue',item.processServer);
			});	
		return;
	}else{
		$.each(data, function(i,item){
			$(formId+ " #documentReceiptId"+i).val(item.id);
			$(formId+" #documentNameNo"+i).textbox('setValue',item.documentNameNo);
			$(formId+" #signature"+i).textbox('setValue',item.signature);
			$(formId+" #deliveryPlace"+i).textbox('setValue',item.deliveryPlace);
			$(formId+" #deliveryType"+i).textbox('setValue',item.deliveryType);
			$(formId+" #processServer"+i).textbox('setValue',item.processServer);
		});	
	}
}


function setInquiryNotesData(data,formId){
	if(null==data || data.length<=0){
		return;
	}else{
		inquiryNotesDetail(data,formId);
		/*$.each(data, function(i,item){
			setData(itme,formId);
		});*/		
	}
}
function setFileListData(data,formId,detailData){
	if(null==data || data.length<=0){
		return;
	}else{
		fileListDetail(data,formId,detailData);
		/*$.each(data, function(i,item){
			setData(itme,formId);
		});*/		
	}
}
function setFileClanListData(data,formId,detailData){
	if(null==data || data.length<=0){
		return;
	}else{
		fileClanListDetail(data,formId,detailData);
		/*$.each(data, function(i,item){
			setData(itme,formId);
		});*/		
	}
}

function setPunishementDecisionData(punishementDecision,formId){
	if(null==punishementDecision)
		return;
	setData(punishementDecision,formId);
	if(punishementDecision.partyType=="个人"){
		$("#punishementDecisionForm #party1").text(punishementDecision.party);
		$("#punishementDecisionForm #partyAddress1").text(punishementDecision.partyAddress == null ? "" : punishementDecision.partyAddress);
	}else{
		$("#punishementDecisionForm #party2").text(punishementDecision.party);
		$("#punishementDecisionForm #partyAddress2").text(punishementDecision.partyAddress == null ? "" : punishementDecision.partyAddress);
	}
}
function setFillingApproveData(fillingApprove,formId){
	if(null==fillingApprove)
		return;
	setData(fillingApprove,formId);
	if(fillingApprove.partyType=="个人"){
		$("#fillingApproveForm #party1").text(fillingApprove.party);
		$("#fillingApproveForm #partyTel1").text(fillingApprove.partyTel);
		$("#fillingApproveForm #partyAddress1").text(fillingApprove.partyAddress);
	}else{
		$("#fillingApproveForm #party2").text(fillingApprove.party);
		$("#fillingApproveForm #partyTel2").text(fillingApprove.partyTel);
		$("#fillingApproveForm #partyAddress2").text(fillingApprove.partyAddress);
	}
}
function setSpotPunishmentDecisionData(spotPunishmentDecision,formId){
	if(null==spotPunishmentDecision)
		return;
	setData(spotPunishmentDecision,formId);
	if(spotPunishmentDecision.partyType=="个人"){
		$("#spotPunishmentDecisionForm #party1").text(spotPunishmentDecision.party);
		$("#spotPunishmentDecisionForm #partyAddress1").text(spotPunishmentDecision.partyAddress);
	}else{
		$("#spotPunishmentDecisionForm #party2").text(spotPunishmentDecision.party);
		$("#spotPunishmentDecisionForm #partyAddress2").text(spotPunishmentDecision.partyAddress);
	}
}
function setPunishmentFinalReportData(punishmentFinalReport,formId){
	if(null==punishmentFinalReport)
		return;
	setData(punishmentFinalReport,formId);
	if(punishmentFinalReport.partyType=="个人"){
		$("#punishmentFinalReportForm #party1").text(punishmentFinalReport.party);
		$("#punishmentFinalReportForm #partyAddress1").text(punishmentFinalReport.partyAddress);
	}else{
		$("#punishmentFinalReportForm #party2").text(punishmentFinalReport.party);
		$("#punishmentFinalReportForm #partyAddress2").text(punishmentFinalReport.partyAddress);
	}
}

function setWithholdCertificateData(withholdCertificate,formId){
	if(null==withholdCertificate)
		return;
	setData(withholdCertificate,formId);
	if(withholdCertificate.partyType=="个人"){
		$("#withholdCertificateForm #party1").text(withholdCertificate.party);
		$("#withholdCertificateForm #partyAddress1").text(withholdCertificate.partyAddress);
	}else{
		$("#withholdCertificateForm #party2").text(withholdCertificate.party);
		$("#withholdCertificateForm #partyAddress2").text(withholdCertificate.partyAddress);
	}
	$("#withholdCertificateForm #fillingPlace1").text(withholdCertificate.fillingPlace);
	$("#withholdCertificateForm #vehicleShipId1").text(withholdCertificate.vehicleShipId);
}

function setSuspensionVehicleDecisionData(suspensionVehicleDecision,formId){
	if(null==suspensionVehicleDecision)
		return;
	setData(suspensionVehicleDecision,formId);
	if(suspensionVehicleDecision.partyType=="个人"){
		$("#suspensionVehicleDecisionForm #party1").text(suspensionVehicleDecision.party);
		$("#suspensionVehicleDecisionForm #partyAddress1").text(suspensionVehicleDecision.partyAddress);
	}else{
		$("#suspensionVehicleDecisionForm #party2").text(suspensionVehicleDecision.party);
		$("#suspensionVehicleDecisionForm #partyAddress2").text(suspensionVehicleDecision.partyAddress);
	}
}

function setVehicleToolsDetainVoucherData(vehicleToolsDetainVoucher,formId){
	if(null==vehicleToolsDetainVoucher)
		return;
	setData(vehicleToolsDetainVoucher,formId);
	if(vehicleToolsDetainVoucher.partyType=="个人"){
		$("#vehicleToolsDetainVoucherForm #party1").text(vehicleToolsDetainVoucher.party);
		$("#vehicleToolsDetainVoucherForm #partyAddress1").text(vehicleToolsDetainVoucher.partyAddress);
	}else{
		$("#vehicleToolsDetainVoucherForm #party2").text(vehicleToolsDetainVoucher.party);
		$("#vehicleToolsDetainVoucherForm #partyAddress2").text(vehicleToolsDetainVoucher.partyAddress);
	}
	$("#vehicleToolsDetainVoucherForm #driverName1").text(vehicleToolsDetainVoucher.driverName);
	$("#vehicleToolsDetainVoucherForm #detainAddress1").text(vehicleToolsDetainVoucher.detainAddress);
}

function setVehicleDetainVoucherData(vehicleDetainVoucher,formId){
	if(null==vehicleDetainVoucher)
		return;
	setData(vehicleDetainVoucher,formId);
	if(vehicleDetainVoucher.partyType=="个人"){
		$("#vehicleDetainVoucherForm #party1").text(vehicleDetainVoucher.party);
		$("#vehicleDetainVoucherForm #partyAddress1").text(vehicleDetainVoucher.partyAddress);
	}else{
		$("#vehicleDetainVoucherForm #party2").text(vehicleDetainVoucher.party);
		$("#vehicleDetainVoucherForm #partyAddress2").text(vehicleDetainVoucher.partyAddress);
	}
	$("#vehicleDetainVoucherForm #vehicleShipId1").text(vehicleDetainVoucher.vehicleShipId);
	$("#vehicleDetainVoucherForm #detainAddress1").text(vehicleDetainVoucher.detainAddress);
}

function setWithholdCertificateOffLine(result){
	var len = result.rows.length;
    var data = new Array();
	for (var i = 0; i < len; i++){
		var withholdCertificate ={};
		withholdCertificate.id=result.rows.item(i).CASE_WITHHOLDCERTIFICATE_ID;
		withholdCertificate.createTime=result.rows.item(i).CREATE_TIME;
		withholdCertificate.modifyTime=result.rows.item(i).MODIFY_TIME;
		withholdCertificate.caseIdWord=result.rows.item(i).CASEID_WORD;
		withholdCertificate.caseIdYear=result.rows.item(i).CASEID_YEAR;
		withholdCertificate.caseIdNo=result.rows.item(i).CASEID_NO;
		withholdCertificate.party=result.rows.item(i).PARTY;
		withholdCertificate.partyAddress=result.rows.item(i).PARTY_ADDRESS;
		withholdCertificate.relation=result.rows.item(i).RELATION;
		withholdCertificate.driveParty=result.rows.item(i).DRIVE_PARTY;
		withholdCertificate.driveNo=result.rows.item(i).DRIVE_NO;
		withholdCertificate.driveAddress=result.rows.item(i).DRIVE_ADDRESS;
		withholdCertificate.reconsiderationOrgan=result.rows.item(i).RECONSIDERATION_ORGAN;
		withholdCertificate.certificateId1=result.rows.item(i).CERTIFICATE_ID_1;
		withholdCertificate.certificateId2=result.rows.item(i).CERTIFICATE_ID_2;
		withholdCertificate.signatureDate1=result.rows.item(i).SIGNATURE_DATE_1;
		withholdCertificate.signatureDate2=result.rows.item(i).SIGNATURE_DATE_2;
		withholdCertificate.withholdYear=result.rows.item(i).WITHHOLD_YEAR;
		withholdCertificate.withholdMonth=result.rows.item(i).WITHHOLD_MONTH;
		withholdCertificate.withholdDay=result.rows.item(i).WITHHOLD_DAY;
		withholdCertificate.withholdHour=result.rows.item(i).WITHHOLD_HOUR;
		withholdCertificate.withholdMinute=result.rows.item(i).WITHHOLD_MINUTE;
		withholdCertificate.fillingPlace=result.rows.item(i).FILLINGPLACE;
		withholdCertificate.vehicleProfile=result.rows.item(i).VEHICLEPROFILE;
		withholdCertificate.vehicleShipId=result.rows.item(i).VEHICLESHIPID;
		withholdCertificate.vehicleShipType=result.rows.item(i).VEHICLESHIPTYPE;
		withholdCertificate.organName=result.rows.item(i).ORGANNAME;
		withholdCertificate.organTel=result.rows.item(i).ORGANTEL;
		withholdCertificate.makeDate=result.rows.item(i).MAKE_DATE;
	    data.push(withholdCertificate);
    }
	return data;
}
/**
 * 通过机构ID查询机构扩展属性
 * @param organId
 */
function queryOrganExtendByIdOffLine(organId){
	findOrganById(organId,setOrganExtendData);
}

/**
 * 初始化文书与机构扩展属性数据
 * @param data
 */
function setOrganExtendData(data){
    $("#account").textbox('setValue',data.account);
    $("#bank").textbox('setValue',data.bank);
    $("#government").textbox('setValue',data.government);
    $("#reconsiderationOrgan").textbox('setValue',data.reconsiderationOrgan);
}
function regInput(reg) {
	var srcElem = event.srcElement;
	var oSel = document.selection.createRange();
	oSel = oSel.duplicate();

	oSel.text = "";
	var srcRange = srcElem.createTextRange();
	oSel.setEndPoint("StartToStart", srcRange);
	var num = oSel.text + String.fromCharCode(event.keyCode)
			+ srcRange.text.substr(oSel.text.length);
	event.returnvalue = reg.test(num);
}

/**
 * 数字转中文
 * @param num
 */
function convertToChinese(num){   
	var N = ["零", "壹","贰","叁","肆","伍","陆","柒","捌","玖","拾"];
	var str = num.toString();    
	var len = num.toString().length;    
	var C_Num = [];    
	for(var i = 0; i < len; i++){
		C_Num.push(N[str.charAt(i)]);
	}    
	return C_Num.join('');
} 

function number(num){
	str = new Array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖");
    tostr = "" + num;
    if(num < 10 ){
        return str[num];
    }else if(num == 10){
        return "拾";
    }else if(num < 20){
        return "拾" + str[tostr.charAt(1)];
    }else if(num == 20){
        return "贰拾";
    }else if(num <30){
        return "贰拾" + str[tostr.charAt(1)];
    }else if(num == 30){
        return "叁拾";
    }else if(num > 30){
        return "叁拾壹" + str[tostr.charAt(1)];
    }
}

//	var chinese = convertToChinese(number);alert(chinese);

/**
 * 金额数字转中文
 * @param num
 * @returns
 */
function chineseNumber(num) {
	if (isNaN(num) || num > Math.pow(10, 12)||num==""||num==undefined){
		return "";
	}
	var cn = "零壹贰叁肆伍陆柒捌玖";
	var unit = new Array("拾百千", "分角");
	var unit1 = new Array("万亿", "");
	var numArray = num.toString().split(".");
	var start = new Array(numArray[0].length - 1, 2);
	
	function toChinese(num, index) {
		var num = num.replace(/\d/g, function($1) {
			return cn.charAt($1)
			+ unit[index].charAt(start-- % 4 ? start % 4 : -1);
		});
		return num;
	}
	
	for (var i = 0; i < numArray.length; i++) {
		var tmp = "";
		for (var j = 0; j * 4 < numArray[i].length; j++) {
			var strIndex = numArray[i].length - (j + 1) * 4;
			var str = numArray[i].substring(strIndex, strIndex + 4);
			var start = i ? 2 : str.length - 1;
			var tmp1 = toChinese(str, i);
			tmp1 = tmp1.replace(/(零.)+/g, "零").replace(/零+$/, "");
			tmp1 = tmp1.replace(/^壹拾/, "拾");
			tmp = (tmp1 + unit1[i].charAt(j - 1)) + tmp;
		}
		numArray[i] = tmp;
	}
	
	numArray[1] = numArray[1] ? numArray[1] : "";
	numArray[0] = numArray[0] ? numArray[0] + "元" : numArray[0],
			numArray[1] = numArray[1].replace(/^零+/, "");
	numArray[1] = numArray[1].match(/分/) ? numArray[1] : numArray[1] + "整";
	return numArray[0] + numArray[1];
}
/**
 * 中文转数字
 * @param num
 * @returns
 */
function aNumber(num) {
	var numArray = new Array();
	var unit = "亿万元$";
	for (var i = 0; i < unit.length; i++) {
		var re = eval_r("/" + (numArray[i - 1] ? unit.charAt(i - 1) : "")
				+ "(.*)" + unit.charAt(i) + "/");
		if (num.match(re)) {
			numArray[i] = num.match(re)[1].replace(/^拾/, "壹拾");
			numArray[i] = numArray[i].replace(/[零壹贰叁肆伍陆柒捌玖]/g, function($1) {
				return "零壹贰叁肆伍陆柒捌玖".indexOf($1);
			});
			numArray[i] = numArray[i].replace(/[分角拾百千]/g, function($1) {
				return "*" + Math.pow(10, "分角 拾百千 ".indexOf($1) - 2) + "+"
			}).replace(/^\*|\+$/g, "").replace(/整/, "0");
			numArray[i] = "(" + numArray[i] + ")*"
					+ Math.ceil(Math.pow(10, (2 - i) * 4));
		} else
			numArray[i] = 0;
	}
	return eval_r(numArray.join("+"));
}

/**
 * 文书样式 输入框转下划线
 */
function documentCss(){
	$("form").find("div").addClass("textmy");
}

/**
 *此段代码曾伟添加
 *根据机构ID获取文书模板列表
 */
function findAllTemplateByOrganIdOnLine(organId,callback,$con){
	if($.trim(organId).length<=0){
		message("初始化模板异常");
		return;
	}else{
	   $.ajax({
			type : "POST",
			url : getContextPath() + "/template/queryTemplateList",
			dataType : "json",
			data : {
				organId:organId
			},
			error : function(request) {
				message("获取模板列表失败");
			},
			success : function(data) {
			if(data.result == 'success'){
				if (typeof(callback) == 'function'){
					callback(data.content,$con);
				}
			  }else{
					message(data.errorCode + ":" +data.errorMessage);
				}
			}
		 });
	}
}

function openShade(){
	$.messager.progress({
        msg:'正在保存数据...'
    });
}

function closeShade(){
	$.messager.progress('close');
}
